Fix build with alpn feature
This commit is contained in:
parent
8f408dae65
commit
dfacea1df6
|
|
@ -1253,7 +1253,7 @@ impl<S: Read+Write> SslStream<S> {
|
||||||
/// This method needs the `alpn` feature.
|
/// This method needs the `alpn` feature.
|
||||||
#[cfg(feature = "alpn")]
|
#[cfg(feature = "alpn")]
|
||||||
pub fn get_selected_alpn_protocol(&self) -> Option<&[u8]> {
|
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).
|
/// pending() takes into account only bytes from the TLS/SSL record that is currently being processed (if any).
|
||||||
|
|
|
||||||
|
|
@ -579,7 +579,7 @@ fn test_npn_server_advertise_multiple() {
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(feature = "alpn")]
|
#[cfg(feature = "alpn")]
|
||||||
fn test_alpn_server_advertise_multiple() {
|
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();
|
let listener = TcpListener::bind(localhost).unwrap();
|
||||||
// We create a different context instance for the server...
|
// We create a different context instance for the server...
|
||||||
let listener_ctx = {
|
let listener_ctx = {
|
||||||
|
|
@ -595,7 +595,7 @@ fn test_alpn_server_advertise_multiple() {
|
||||||
// Have the listener wait on the connection in a different thread.
|
// Have the listener wait on the connection in a different thread.
|
||||||
thread::spawn(move || {
|
thread::spawn(move || {
|
||||||
let (stream, _) = listener.accept().unwrap();
|
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();
|
let mut ctx = SslContext::new(Sslv23).unwrap();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue