From bc0389e9c5a5057d38a589b8a836869907f02d2f Mon Sep 17 00:00:00 2001 From: BiagioFesta <15035284+BiagioFesta@users.noreply.github.com> Date: Fri, 4 Oct 2024 14:09:17 +0200 Subject: [PATCH] crypto: expose negotiated_cipher_suite in the hadshake data --- quinn-proto/src/crypto/rustls.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/quinn-proto/src/crypto/rustls.rs b/quinn-proto/src/crypto/rustls.rs index b84151811..03769a244 100644 --- a/quinn-proto/src/crypto/rustls.rs +++ b/quinn-proto/src/crypto/rustls.rs @@ -64,6 +64,11 @@ impl crypto::Session for TlsSession { Connection::Client(_) => None, Connection::Server(ref session) => session.server_name().map(|x| x.into()), }, + negotiated_cipher_suite: self + .inner + .negotiated_cipher_suite() + .expect("cipher is negotiated") + .suite(), })) } @@ -256,6 +261,9 @@ pub struct HandshakeData { /// /// Always `None` for outgoing connections pub server_name: Option, + + /// The ciphersuite negotiated with the peer. + pub negotiated_cipher_suite: CipherSuite, } /// A QUIC-compatible TLS client configuration