[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Stream error in framing layer



On 4/8/24 4:51 am, Benoît Minisini wrote:
Le 02/08/2024 à 14:18, BB a écrit :
I use a JSON download via httpclient to retrieve some live data. Recently I have been getting a consistent failure with the heading "error". This error, according to the internet pundits is something to do with the server doing http2 badly.

Their answer is to force curl (via httpclient) to use headers to force the server to reply in http1.1

It seems that I need to set some header to use the value "CURL_HTTP_VERSION_1_1" somehow. I have not been able to work out how to this, so has anyone got any clues?

tia

b



You can specify the headers of your request with the 'Header' argument of the 'Get()' or 'Post()' method. Will it solve your problem?

Well, it turns out it won't.

It appears that to force the version that curl tells the server to use has to be specified at the end of the curl GET command. Here's a debug trace, I redacted the adresses as it's a private account.


*   Trying *.*.*.*:443...
* Connected to *****.au (*.*.*.*) port 443 (#0)
* found 389 certificates in /etc/ssl/certs
* ALPN, offering h2
* ALPN, offering http/1.1 <---- Does offer v 1.1
* SSL connection using TLS1.3 / ECDHE_RSA_AES_256_GCM_SHA384
*        server certificate verification OK
*        server certificate status verification SKIPPED
*        common name: *.beta.tab.com.au (matched)
*        server certificate expiration date OK
*        server certificate activation date OK
*        certificate public key: EC/ECDSA
*        certificate version: #3
*        start date: Fri, 22 Mar 2024 00:00:00 GMT
*        expire date: Sat, 22 Mar 2025 23:59:59 GMT
*        issuer: C=US,O=DigiCert Inc,CN=DigiCert TLS RSA SHA256 2020 CA1
* ALPN, server accepted to use h2
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x55a6e5f5c960)
> GET /v1/*******?jurisdiction=SA *_HTTP/2 _             <--- This is where I need HTTP/1.1 in the curl url sent*
Host: *.com.au
user-agent: Mozilla/5.0 (X11; Linux x86_64; rv:123.0) Gecko/20100101 Firefox/123.0
accept: */*

* Connection state changed (MAX_CONCURRENT_STREAMS == 100)!
* HTTP/2 stream 0 was not closed cleanly: INTERNAL_ERROR (err 2)
* stopped the pause stream!
* Connection #0 to host *.com.au left intact
-1      Stream error in the HTTP/2 framing layer
http.status = -1092


... some time later

I have found that the same thing happens with www.tesla.com

So that's a public URL that can be used to check this.

Apparently, it can be solved by setting a curl option (not a header item)

|curl_setopt($curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);|

|
|

|whatever that means?|

|thanks for looking
|

|b
|


Follow-Ups:
Re: Stream error in framing layerBenoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>
References:
Stream error in framing layerBB <adamnt42@xxxxxxxxx>
Re: Stream error in framing layerBenoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>