-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Running rustls example results in panic on the server side #1183
Comments
It works for me locally on my mac so not sure why its failing for you server:
client:
|
You could try enabling logging to see if it tells you anything. |
Hey! Thanks for the reply, I can retry with logs enabled. The other problem I had is that the list of client certs is empty: |
Here is the output log, but I don't see any obvious problem 🤔
|
Can you tell me what commit you're on? And verify you've changed nothing? Maybe this has to do with linux kernel 6 |
I'm on d00fd08. I have no local changes other than logging enabled (but initially checked without logging) diff --git a/examples/src/tls/server_rustls.rs b/examples/src/tls/server_rustls.rs
index 8985cf0..e2371e4 100644
--- a/examples/src/tls/server_rustls.rs
+++ b/examples/src/tls/server_rustls.rs
@@ -12,9 +12,13 @@ use tokio_rustls::{
};
use tonic::{transport::Server, Request, Response, Status};
use tower_http::ServiceBuilderExt;
+use tracing_subscriber::EnvFilter;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
+ let filter = EnvFilter::try_from_default_env().unwrap_or_else(|_| EnvFilter::new("debug"));
+ tracing_subscriber::fmt().with_env_filter(filter).init();
+
let certs = {
let fd = std::fs::File::open("examples/data/tls/server.pem")?;
let mut buf = std::io::BufReader::new(&fd);
|
Let me know what else I can check. I'm happy to dig into this :) |
Could you clarify the full version of your OS and linux kernel? I am having trouble finding out what version you are using etc. |
OS: Pop!_OS 22.04 LTS It is based on Ubuntu 22.04 LTS, but they provide updated kernel, I guess. |
I can reproduce on ubuntu 22.04 with |
Same here I can reproduce it on debian with kernel 6. I also updated my code locally on my mac and was not able to reproduce with the same version of rustls. Additionally, this only happens with the rustls and not the general helloworld. |
Ok so its not a linux kernel 6+ issue, I am seeing it on 5.4 as well. |
Okay so I've been digging some more, beyond the As for the eof part of this, I am still debugging it but it doesn'thappen @quinner do you have any idea? When I get eof I see there is around 8k bytes in the buf and thats why its returning eof but I don't know beyond that why its failing. |
Platform the same happens The client does not send out "warning alert Close_Notify", not every time |
@LucioFranco we've experienced this as well a lot seemingly randomly in prod and I wonder if you think these two issues could be related hyperium/h2#636? |
Same two symptoms for me in
My setup:
Also happens outside of examples in the repo, in another project where dep versions mostly mirror those from the examples:
Consistently, every time, not just intermittent/random. |
I'm also having this issue on macOS 14.3 with rustc 1.76.0. This repo https://github.com/kc1212/tonic-tls-poc will reproduce the issue by starting the server and then the client. The code is essentially what is in the rustls example. Below is the error message:
|
Bug Report
Version
master
Platform
Linux pop-os 6.0.6-76060006-generic x86_64
Description
Running
tls_rustls
example results in panic on the server side:server:
cargo run --bin tls-server-rustls
client:
cargo run --bin tls-client-rustls
then on server:
Expected behavior: example is working without errors.
The text was updated successfully, but these errors were encountered: