From a5d9bd1154b7644ff22b75191a89db9687546fdb 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 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/quinn-proto/src/crypto/rustls.rs b/quinn-proto/src/crypto/rustls.rs index d60740bb3..02d26a1c6 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,8 @@ 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