diff --git a/openssl/src/ssl/mod.rs b/openssl/src/ssl/mod.rs index d67dc1a2..cf885201 100644 --- a/openssl/src/ssl/mod.rs +++ b/openssl/src/ssl/mod.rs @@ -1253,7 +1253,7 @@ impl SslStream { /// This method needs the `alpn` feature. #[cfg(feature = "alpn")] pub fn get_selected_alpn_protocol(&self) -> Option<&[u8]> { - self.ssl.get_selected_alpn_protocol() + self.kind.ssl().get_selected_alpn_protocol() } /// pending() takes into account only bytes from the TLS/SSL record that is currently being processed (if any). diff --git a/openssl/src/ssl/tests.rs b/openssl/src/ssl/tests.rs index b44b9c35..8401836d 100644 --- a/openssl/src/ssl/tests.rs +++ b/openssl/src/ssl/tests.rs @@ -579,7 +579,7 @@ fn test_npn_server_advertise_multiple() { #[test] #[cfg(feature = "alpn")] fn test_alpn_server_advertise_multiple() { - let localhost = "127.0.0.1:15420"; + let localhost = "127.0.0.1:15421"; let listener = TcpListener::bind(localhost).unwrap(); // We create a different context instance for the server... let listener_ctx = { @@ -595,7 +595,7 @@ fn test_alpn_server_advertise_multiple() { // Have the listener wait on the connection in a different thread. thread::spawn(move || { let (stream, _) = listener.accept().unwrap(); - let _ = SslStream::new_server(&listener_ctx, stream).unwrap(); + let _ = SslStream::accept(&listener_ctx, stream).unwrap(); }); let mut ctx = SslContext::new(Sslv23).unwrap();