-
Notifications
You must be signed in to change notification settings - Fork 154
HTTP/2 over HTTPS has a problem, but HTTP/1.1 over HTTPS does not #141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Can you try enabling both the Hyper 0.14 doesn't enable HTTP/1 and HTTP/2 support by default, but hyper-rustls enables the |
Thanks for the reply.
I think I enabled both: https://github.com/nwtgck/public-code/blob/4e41b1801f1a44357cb9af8824b06083c72d5e64/hyper-0-14-http2-unexpected-eof-problem/Cargo.toml#L10 |
Try using |
Thanks. It solved the issue! |
Here is the successful result with $ curl -vvv -k --http2 https://localhost:8443/
* Trying ::1...
* TCP_NODELAY set
* Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 8443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
* CAfile: /etc/ssl/cert.pem
CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (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, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
* ALPN, server accepted to use h2
* Server certificate:
* subject: CN=localhost
* start date: Jan 6 15:33:09 2021 GMT
* expire date: Jan 6 15:33:09 2022 GMT
* issuer: CN=localhost
* SSL certificate verify result: self signed certificate (18), continuing anyway.
* 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 0x7fa406806600)
> GET / HTTP/2
> Host: localhost:8443
> User-Agent: curl/7.54.0
> Accept: */*
>
* Connection state changed (MAX_CONCURRENT_STREAMS updated)!
< HTTP/2 200
< date: Wed, 06 Jan 2021 17:46:17 GMT
< content-length: 13
<
hello, world
* Connection #0 to host localhost left intact |
isn't it possible to use only http2 without ssl |
In general, no, HTTP/2 is commonly only deployed with TLS enabled. |
I believe this is not part of the standard: https://http2.github.io/faq/ Hyper should support HTTP/2 regardless. |
Hi. Thank you for your wonderful project!
I upgrade hyper to 0.14 and hyper-rustls from 0.14 to 0.22. Then, I got an error only on HTTP/2 over HTTPS.
How to reproduce the error?
I created a minimal sample here:
Type the following commands to run an HTTPS server.
Then, https://localhost:8443/ is served.
I got "hello, world" successfully when using HTTP/1.1 over HTTPS like the following.
But, I got an error when using HTTP/2 over HTTPS like the following.
Here is verbose output with
-vvv
.I got an error in Web browser too. Honestly speaking, I am not sure which library causes the error: tokio, hyper, tokio-rustls, rustls, hyper-rustls, so I may post the issue on wrong place.
When I used like the following dependencies with hyper 0.13 and the same rust code, HTTP/2 over HTTPS worked as I expected.
The text was updated successfully, but these errors were encountered: