curl / curl

A command line tool and library for transferring data with URL syntax, supporting DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET, TFTP, WS and WSS. libcurl offers a myriad of powerful features
https://curl.se/
Other
35.97k stars 6.44k forks source link

HTTP/2 stream 1 was not closed cleanly: PROTOCOL_ERROR (err 1) #13002

Closed xuwenlong02 closed 8 months ago

xuwenlong02 commented 8 months ago

I did this

curl --http2 "https://mat1.gtimg.com/qqcdn/xw/favicon.ico" -v, As below:

== Info: WARNING: failed to open cookie file ""
== Info:   Trying [2408:874e:2:212:1::aa1]:443...

== Info: Connected to mat1.gtimg.com (2408:874e:2:212:1::aa1) port 443
== Info: ALPN: curl offers h2,http/1.1
== Info: TLSv1.3 (OUT), TLS handshake, Client hello (1):
== Info:  CAfile: /etc/ssl/certs/cacert.pem
== Info:  CApath: /etc/security/certificates
== Info: TLSv1.3 (IN), TLS handshake, Server hello (2):
== Info: TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
== Info: TLSv1.3 (IN), TLS handshake, Certificate (11):
== Info: TLSv1.3 (IN), TLS handshake, CERT verify (15):
== Info: TLSv1.3 (IN), TLS handshake, Finished (20):
== Info: TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
== Info: TLSv1.3 (OUT), TLS handshake, Finished (20):
== Info: SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
== Info: ALPN: server accepted h2
== Info: Server certificate:
== Info:  subject: C=CN; ST=Guangdong; L=Shenzhen; O=Shenzhen Tencent Computer Systems Company Limited; CN=*.gtimg.com
== Info:  start date: Mar 31 04:01:03 2023 GMT
== Info:  expire date: May  1 04:01:02 2024 GMT
== Info:  subjectAltName: host "mat1.gtimg.com" matched cert's "*.gtimg.com"
== Info:  issuer: C=BE; O=GlobalSign nv-sa; CN=GlobalSign Organization Validation CA - SHA256 - G3
== Info:  SSL certificate verify ok.
== Info: using HTTP/2
== Info: [HTTP/2] [1] OPENED stream for https://mat1.gtimg.com/qqcdn/xw/favicon.ico
== Info: [HTTP/2] [1] [:method: GET]
== Info: [HTTP/2] [1] [:scheme: https]
== Info: [HTTP/2] [1] [:authority: mat1.gtimg.com]
== Info: [HTTP/2] [1] [:path: /qqcdn/xw/favicon.ico]
== Info: [HTTP/2] [1] [user-agent: libcurl-agent/1.0]
== Info: [HTTP/2] [1] [accept: */*]
== Info: [HTTP/2] [1] [accept-encoding: deflate, gzip]
== Info: TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
== Info: TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
== Info: old SSL session ID is stale, removing

== Info: HTTP/2 stream 1 was not closed cleanly: PROTOCOL_ERROR (err 1)
== Info: Connection #0 to host mat1.gtimg.com left intact

Sync Http task of url https://mat1.gtimg.com/qqcdn/xw/favicon.ico failed, response code 92, msg from netStack: CURLE_HTTP2_STREAM
download failed

I expected the following

download ok

curl/libcurl version

curl 8.0.1-DEV (arm-linux-ohos) libcurl/8.4.0 OpenSSL/3.0.9 zlib/1.2.13 c-ares/1.18.1 nghttp2/1.52.0 Release-Date: [unreleased] Protocols: dict file ftp ftps gopher gophers http https imap imaps mqtt pop3 pop3s rtsp smb smbs smtp smtps telnet tftp Features: alt-svc AsynchDNS HTTP2 HTTPS-proxy IPv6 Largefile libz NTLM NTLM_WB SSL threadsafe TLS-SRP UnixSockets

operating system

Linux localhost 5.10.180 #2 SMP Fri Jan 19 19:11:56 CST 2024 aarch64

icing commented 8 months ago

@xuwenlong02 we had several fixes in HTTP/2 handling since version 8.0.1. Could you try the current version if this remains failing for you? Thanks.

xuwenlong02 commented 8 months ago

ok

---- Replied Message ---- | From | Stefan @.> | | Date | 02/27/2024 19:36 | | To | @.> | | Cc | Wenlong @.>@.> | | Subject | Re: [curl/curl] HTTP/2 stream 1 was not closed cleanly: PROTOCOL_ERROR (err 1) (Issue #13002) |

@xuwenlong02 we had several fixes in HTTP/2 handling since version 8.0.1. Could you try the current version if this remains failing for you? Thanks.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

xuwenlong02 commented 8 months ago

@xuwenlong02 we had several fixes in HTTP/2 handling since version 8.0.1. Could you try the current version if this remains failing for you? Thanks.

Can you tell me where is the diff files

bagder commented 8 months ago

@xuwenlong02 the entire source code is in git, feel free to diff everything you want.