-
Notifications
You must be signed in to change notification settings - Fork 51
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
Error NotConnected
when serving a TlsStream<TcpStream>
when using hyper
#41
Comments
I'm not sure why this is yielding |
I think the underlying error comes from the |
Okay, so I think this happens because tokio-rustls tries to write outgoing data to the https://github.com/rustls/tokio-rustls/blob/main/src/common/mod.rs#L335 tokio-native-tls doesn't do this: https://github.com/tokio-rs/tls/blob/master/tokio-native-tls/src/lib.rs#L218 Looks like this behavior was first added this behavior in 7949f43 about 5 years ago. @quininer do you remember why this is necessary? Relevant context from tokio's
|
#42 proposes just swallowing |
When serving a
TlsStream<TcpStream>
using ahyper
server, the stream'spoll_shutdown
method sometimes returns aio::ErrorKind::NotConnected
. This happens when calling the server using curl withHTTP/1.1
, but not withHTTP/1.0
. Also, it happens when calling the server usingopenssl s_client
and pressingctrl+c
instead ofctrl+d
.It seems that when a client doesn't explicitly close the connection, but simply hangs up, the stream ends with an error.
This only happens with
tokio_rustls
and not withtokio_native_tls
.Here is a somewhat minimal reproduction of the error:
To reproduce using curl:
curl -k -v https://localhost:8080 --http1.0
gives no error.curl -k -v https://localhost:8080 --http1.1
gives aNotConnected
error.To reproduce using
openssl s_client
:openssl s_client -connect localhost:8080
thenCtrl+D
gives no error.openssl s_client -connect localhost:8080
thenCtrl+C
gives aNotConnected
error.The text was updated successfully, but these errors were encountered: