quinn-rs / quinn

Async-friendly QUIC implementation in Rust
Apache License 2.0
3.85k stars 394 forks source link

insecure_connection example fails to run #1361

Closed wmmc88 closed 2 years ago

wmmc88 commented 2 years ago
quinn on  HEAD (587fe0f) via 🦀 v1.60.0 
❯ cargo run --example insecure_connection --features="rustls/dangerous_configuration"
    Finished dev [unoptimized + debuginfo] target(s) in 0.04s
     Running `target/debug/examples/insecure_connection`
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ConnectionClosed(ConnectionClose { error_code: Code::crypto(78), frame_type: None, reason: b"peer doesn't support any known protocol" })', quinn/examples/insecure_connection.rs:44:10
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

running this repo on the 0.8.3 tag.

djc commented 2 years ago

Oh, interesting... so I think this is caused by the changes in https://github.com/rustls/rustls/pull/873 (first released in rustls 0.20.3) and we forgot to audit our examples in https://github.com/quinn-rs/quinn/pull/1258. Here, the client issues an ALPN protocol but the server doesn't set any; in fact, our simple server rustls configuration APIs don't offer the opportunity to set any ALPN protocols at all.

Ralith commented 2 years ago

This was fixed in main by 5822ff3781f1e3dde2e9dc41d28334910db750ca. Do we want to bother backporting example fixes to maintenance branches?

djc commented 2 years ago

Probably not proactively, but since we've already done the work on identifying this, might as well backport it? No need to release it, I think. See #1363.

Ralith commented 2 years ago

Good point.