Roy Hashimoto created HTTPCORE-786:
--------------------------------------
Summary: H2 server closes connection on some clients
Key: HTTPCORE-786
URL: https://issues.apache.org/jira/browse/HTTPCORE-786
Project: HttpComponents HttpCore
Issue Type: Bug
Components: HttpCore
Affects Versions: 5.3.6
Reporter: Roy Hashimoto
Attachments: chrome-ok.log, curl-fail.log, firefox-ok.log,
safari-fail.log
I am seeing curl 7.88.1 and 8.7.1 and Safari 18.6 report a dropped connection
from my httpcore5-h2 server. My Intellij project is
[here|[https://github.com/rhashimoto/httpcore5-reset-repro/tree/master],] with
the Kotlin code
[here|[https://github.com/rhashimoto/httpcore5-reset-repro/blob/master/src/main/kotlin/Main.kt].]
This is a HTTPS server that allows HTTP2. It returns the plain text "Hello,
World" for every request.
Here is sample curl output:
{{$ curl -kv https://localhost:8443/}}
{{* Trying 127.0.0.1:8443...}}
{{* Connected to localhost (127.0.0.1) port 8443 (#0)}}
{{* ALPN: offers h2,http/1.1}}
{{* TLSv1.3 (OUT), TLS handshake, Client hello (1):}}
{{* TLSv1.3 (IN), TLS handshake, Server hello (2):}}
{{* TLSv1.2 (IN), TLS handshake, Certificate (11):}}
{{* TLSv1.2 (IN), TLS handshake, Server key exchange (12):}}
{{* TLSv1.2 (IN), TLS handshake, Server finished (14):}}
{{* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):}}
{{* TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):}}
{{* TLSv1.2 (OUT), TLS handshake, Finished (20):}}
{{* TLSv1.2 (IN), TLS handshake, Finished (20):}}
{{* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256}}
{{* ALPN: server accepted h2}}
{{* Server certificate:}}
{{* subject: CN=localhost}}
{{* start date: Sep 18 22:47:40 2025 GMT}}
{{* expire date: Sep 16 22:47:40 2035 GMT}}
{{* issuer: CN=localhost}}
{{* SSL certificate verify result: self-signed certificate (18), continuing
anyway.}}
{{* using HTTP/2}}
{{* h2h3 [:method: GET]}}
{{* h2h3 [:path: /]}}
{{* h2h3 [:scheme: https]}}
{{* h2h3 [:authority: localhost:8443]}}
{{* h2h3 [user-agent: curl/7.88.1]}}
{{* h2h3 [accept: */*]}}
{{* Using Stream ID: 1 (easy handle 0x56250ad2cce0)}}
{{> GET / HTTP/2}}
{{> Host: localhost:8443}}
{{> user-agent: curl/7.88.1}}
{{> accept: */*}}
{{> }}
{{* Empty reply from server}}
{{* Closing connection 0}}
{{curl: (52) Empty reply from server}}
So curl is saying the server returns nothing. Similarly, Safari says "Safari
can't open the page...because the server unexpectedly dropped the connection."
However, both Chrome and Firefox display "Hello, World" as expected.
Four logs are attached, one for each client, showing httpcore5 debugging info.
I notice that both of the failing clients report something similar:
{{2025-09-26 21:40:55 [server-dispatch-1] DEBUG org.apache.hc.core5.http.wire -
<< ..1............. 00 00 31 07 00 00 00 00 00 00 00 00 00 00 00 00}}
{{2025-09-26 21:40:55 [server-dispatch-1] DEBUG org.apache.hc.core5.http.wire -
<< .SETTINGS: serve 01 53 45 54 54 49 4e 47 53 3a 20 73 65 72 76 65}}
{{2025-09-26 21:40:55 [server-dispatch-1] DEBUG org.apache.hc.core5.http.wire -
<< r attempted to e 72 20 61 74 74 65 6d 70 74 65 64 20 74 6f 20 65}}
{{2025-09-26 21:40:55 [server-dispatch-1] DEBUG org.apache.hc.core5.http.wire -
<< nable push 6e 61 62 6c 65 20 70 75 73 68}}
{{2025-09-26 21:40:55 [server-dispatch-1] DEBUG org.apache.hc.core5.http2.frame
- a-0000000000 << stream 0 frame: GOAWAY (0x7); flags: (0x0); length: 49}}
{{2025-09-26 21:40:55 [server-dispatch-1] DEBUG
org.apache.hc.core5.http2.frame.payload - a-0000000000 << Last stream 0}}
{{2025-09-26 21:40:55 [server-dispatch-1] DEBUG
org.apache.hc.core5.http2.frame.payload - a-0000000000 << Code PROTOCOL_ERROR}}
{{2025-09-26 21:40:55 [server-dispatch-1] DEBUG
org.apache.hc.core5.http2.frame.payload - a-0000000000 << SETTINGS: server
attempted to enable push}}
{{2025-09-26 21:40:55 [server-dispatch-1] DEBUG
org.apache.hc.core5.reactor.ssl.SSLIOSession -
a-0000000000[ACTIVE][rw:r][ACTIVE][rw][NOT_HANDSHAKING][87][58][0] event set
[w]}}
{{2025-09-26 21:40:55 [server-dispatch-1] DEBUG
org.apache.hc.core5.reactor.ssl.SSLIOSession -
a-0000000000[ACTIVE][rw:r][ACTIVE][rw][NOT_HANDSHAKING][87][58][0] 0 bytes
read}}
{{2025-09-26 21:40:55 [server-dispatch-1] DEBUG
org.apache.hc.core5.http.connection -
a-0000000000[ACTIVE][rw:r][ACTIVE][rw][NOT_HANDSHAKING][0][0][0] output ready}}
{{2025-09-26 21:40:55 [server-dispatch-1] DEBUG
org.apache.hc.core5.reactor.ssl.SSLIOSession -
a-0000000000[ACTIVE][rw:r][ACTIVE][rw][NOT_HANDSHAKING][0][0][0] shutdown
GRACEFUL}}
{{2025-09-26 21:40:55 [server-dispatch-1] DEBUG
org.apache.hc.core5.http.connection -
a-0000000000[ACTIVE][rw:rw][CLOSING][rw][NOT_HANDSHAKING][outbound
done][][0][0][31] input ready}}
{{2025-09-26 21:40:55 [server-dispatch-1] ERROR
org.apache.hc.core5.http.connection -
a-0000000000[ACTIVE][rw:rw][CLOSING][rw][NOT_HANDSHAKING][outbound
done][][0][0][31] Connection reset}}
{{java.net.SocketException: Connection reset}}
{{ at
java.base/sun.nio.ch.SocketChannelImpl.throwConnectionReset(SocketChannelImpl.java:399)}}
{{ at
java.base/sun.nio.ch.SocketChannelImpl.implRead(SocketChannelImpl.java:431)}}
{{ at java.base/sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:489)}}
{{ at org.apache.hc.core5.reactor.IOSessionImpl.read(IOSessionImpl.java:206)}}
{{ at
org.apache.hc.core5.reactor.ssl.SSLIOSession.receiveEncryptedData(SSLIOSession.java:586)}}
{{ at
org.apache.hc.core5.reactor.ssl.SSLIOSession.access$000(SSLIOSession.java:74)}}
{{ at
org.apache.hc.core5.reactor.ssl.SSLIOSession$1.inputReady(SSLIOSession.java:202)}}
{{ at
org.apache.hc.core5.reactor.InternalDataChannel.onIOEvent(InternalDataChannel.java:139)}}
{{ at
org.apache.hc.core5.reactor.InternalChannel.handleIOEvent(InternalChannel.java:51)}}
{{ at
org.apache.hc.core5.reactor.SingleCoreIOReactor.processEvents(SingleCoreIOReactor.java:176)}}
{{ at
org.apache.hc.core5.reactor.SingleCoreIOReactor.doExecute(SingleCoreIOReactor.java:125)}}
{{ at
org.apache.hc.core5.reactor.AbstractSingleCoreIOReactor.execute(AbstractSingleCoreIOReactor.java:92)}}
{{ at org.apache.hc.core5.reactor.IOReactorWorker.run(IOReactorWorker.java:44)}}
{{ at java.base/java.lang.Thread.run(Thread.java:1447)}}
{{2025-09-26 21:40:55 [server-dispatch-1] DEBUG
org.apache.hc.core5.reactor.ssl.SSLIOSession -
a-0000000000[CLOSED][][CLOSING][rw][NOT_HANDSHAKING][outbound done][][0][0][31]
shutdown GRACEFUL}}
{{2025-09-26 21:40:55 [server-dispatch-1] DEBUG
org.apache.hc.core5.http.connection - a-0000000000[CLOSED][] disconnected}}
I don't have the expertise to debug at this level but it looks to me that curl
(in this case) is aborting because the server is trying to enable server push.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]