File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,17 +21,25 @@ impl HttpVersion {
2121 pub fn from_negotiated_protocol_server < IO > ( tls : & tokio_rustls:: server:: TlsStream < IO > ) -> Self {
2222 let ( _io, conn) = tls. get_ref ( ) ;
2323
24- let chosen_protocol = Self :: from_alpn_bytes ( conn. alpn_protocol ( ) ) ;
25- tracing:: debug!( "[server] Chosen protocol {chosen_protocol:?}" , ) ;
24+ let negotiated_alpn = conn. alpn_protocol ( ) ;
25+ let chosen_protocol = Self :: from_alpn_bytes ( negotiated_alpn) ;
26+ tracing:: debug!(
27+ "[server] Negotiated ALPN {:?}, chosen protocol {chosen_protocol:?}" ,
28+ negotiated_alpn. map( String :: from_utf8_lossy)
29+ ) ;
2630 chosen_protocol
2731 }
2832
2933 /// Given a client TLS stream, choose an HTTP version to use
3034 pub fn from_negotiated_protocol_client < IO > ( tls : & tokio_rustls:: client:: TlsStream < IO > ) -> Self {
3135 let ( _io, conn) = tls. get_ref ( ) ;
3236
33- let chosen_protocol = Self :: from_alpn_bytes ( conn. alpn_protocol ( ) ) ;
34- tracing:: debug!( "[client] Chosen protocol {chosen_protocol:?}" , ) ;
37+ let negotiated_alpn = conn. alpn_protocol ( ) ;
38+ let chosen_protocol = Self :: from_alpn_bytes ( negotiated_alpn) ;
39+ tracing:: debug!(
40+ "[client] Negotiated ALPN {:?}, chosen protocol {chosen_protocol:?}" ,
41+ negotiated_alpn. map( String :: from_utf8_lossy)
42+ ) ;
3543 chosen_protocol
3644 }
3745
You can’t perform that action at this time.
0 commit comments