curl / Mailing Lists / curl-users / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

ALPN - HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR

From: Robert Wolf via curl-users <curl-users_at_lists.haxx.se>
Date: Tue, 5 Jul 2022 19:06:48 +0200

Dear CURL group,

we are facing some problem with http2. We have one server which should send PDF
files. Running with cloudflare, the browser gets incomplete file. Without CF
the server sends the file complete. With CF with http2 deactivated the file is
complete too.

We can replicate the problem using curl directly to server without CF.

We get CURL request from firefox (copy as curl). With --http2 the file is
incomplete and the curl returns "HTTP/2 stream 0 was not closed cleanly:
PROTOCOL_ERROR". With --http1.1 the file is complete.

I have read the man curl page and found the option --no-alpn. Using both
options --http2 and --no-alpn the file is complete. So there must be something
with ALPN in HTTP2.

But the ALPN is enabled also in firefox and the download work without any
problem there and the file is complete.

Using --trace I can see the missing ALPN in the trace of --no-alpn, but I can
see the different length of data segments too - 16375B with ALPN and 8192B
without ALPN.

I have found a few reports about this "PROTOCOL ERROR" with workaround to
downgrade to http1.1. But this is not a real solution.

I have found the issue 3206 https://github.com/curl/curl/issues/3206 closed
with "This is a broken server and not a curl problem."

Do you have any idea, how to test or prove the problem is on the server? There
is problem with CURL and Cloudflare, but direct connection from Firefox (and
other browsers) is OK. I presume, if we find the solution for curl, then this
will be same solution for cloudflare, resp. this will be solution how to fix
the server.

Thank you very much for any hints.

Regards,

Robert Wolf.
-- 
Unsubscribe: https://lists.haxx.se/listinfo/curl-users
Etiquette:   https://curl.se/mail/etiquette.html
Received on 2022-07-05