adds ability access the internal &SslContext of an SslAcceptor and SslConnector
This commit is contained in:
parent
62187377b5
commit
c81810d869
|
|
@ -4,7 +4,7 @@ use std::ops::{Deref, DerefMut};
|
|||
use dh::Dh;
|
||||
use error::ErrorStack;
|
||||
use ssl::{
|
||||
HandshakeError, Ssl, SslContext, SslContextBuilder, SslMethod, SslMode, SslOptions, SslRef,
|
||||
HandshakeError, Ssl, SslContext, SslContextRef, SslContextBuilder, SslMethod, SslMode, SslOptions, SslRef,
|
||||
SslStream, SslVerifyMode,
|
||||
};
|
||||
use version;
|
||||
|
|
@ -91,6 +91,14 @@ impl SslConnector {
|
|||
verify_hostname: true,
|
||||
})
|
||||
}
|
||||
|
||||
pub fn into_ssl_context(self) -> SslContext {
|
||||
self.0
|
||||
}
|
||||
|
||||
pub fn ssl_context_ref(&self) -> &SslContextRef {
|
||||
&*self.0
|
||||
}
|
||||
}
|
||||
|
||||
/// A builder for `SslConnector`s.
|
||||
|
|
@ -301,6 +309,14 @@ impl SslAcceptor {
|
|||
let ssl = Ssl::new(&self.0)?;
|
||||
ssl.accept(stream)
|
||||
}
|
||||
|
||||
pub fn into_ssl_context(self) -> SslContext {
|
||||
self.0
|
||||
}
|
||||
|
||||
pub fn ssl_context_ref(&self) -> &SslContextRef {
|
||||
&*self.0
|
||||
}
|
||||
}
|
||||
|
||||
/// A builder for `SslAcceptor`s.
|
||||
|
|
|
|||
Loading…
Reference in New Issue