Loading openssl/src/ssl/connector.rs +20 −4 Original line number Diff line number Diff line Loading @@ -3,7 +3,7 @@ use std::ops::{Deref, DerefMut}; use dh::Dh; use error::ErrorStack; use ssl::{self, HandshakeError, Ssl, SslContext, SslContextBuilder, SslMethod, SslStream, use ssl::{self, HandshakeError, Ssl, SslRef, SslContext, SslContextBuilder, SslMethod, SslStream, SSL_VERIFY_PEER}; use pkey::PKeyRef; use version; Loading Loading @@ -91,7 +91,7 @@ impl SslConnectorBuilder { self } /// Consumes the builder, returning a `SslConnector`. /// Consumes the builder, returning an `SslConnector`. pub fn build(self) -> SslConnector { SslConnector(self.0.build()) } Loading Loading @@ -162,12 +162,14 @@ impl SslConnector { pub struct ConnectConfiguration(Ssl); impl ConnectConfiguration { /// Returns a shared reference to the inner `Ssl`. #[deprecated(since = "0.9.23", note = "ConnectConfiguration now implements Deref<Target=SslRef>")] pub fn ssl(&self) -> &Ssl { &self.0 } /// Returns a mutable reference to the inner `Ssl`. #[deprecated(since = "0.9.23", note = "ConnectConfiguration now implements DerefMut<Target=SslRef>")] pub fn ssl_mut(&mut self) -> &mut Ssl { &mut self.0 } Loading Loading @@ -207,6 +209,20 @@ impl ConnectConfiguration { } } impl Deref for ConnectConfiguration { type Target = SslRef; fn deref(&self) -> &SslRef { &self.0 } } impl DerefMut for ConnectConfiguration { fn deref_mut(&mut self) -> &mut SslRef { &mut self.0 } } /// A builder for `SslAcceptor`s. pub struct SslAcceptorBuilder(SslContextBuilder); Loading openssl/src/ssl/error.rs +4 −1 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ use error::ErrorStack; use ssl::MidHandshakeSslStream; /// An SSL error. // FIXME this is missing variants #[derive(Debug)] pub enum Error { /// The SSL session has been closed by the other end Loading Loading @@ -100,7 +101,9 @@ pub enum HandshakeError<S> { SetupFailure(ErrorStack), /// The handshake failed. Failure(MidHandshakeSslStream<S>), /// The handshake was interrupted midway through. This error will never be returned for blocking streams. /// The handshake was interrupted midway through. /// /// This error will never be returned for blocking streams. // FIXME change to WouldBlock Interrupted(MidHandshakeSslStream<S>), } Loading openssl/src/ssl/mod.rs +217 −45 File changed.Preview size limit exceeded, changes collapsed. Show changes Loading
openssl/src/ssl/connector.rs +20 −4 Original line number Diff line number Diff line Loading @@ -3,7 +3,7 @@ use std::ops::{Deref, DerefMut}; use dh::Dh; use error::ErrorStack; use ssl::{self, HandshakeError, Ssl, SslContext, SslContextBuilder, SslMethod, SslStream, use ssl::{self, HandshakeError, Ssl, SslRef, SslContext, SslContextBuilder, SslMethod, SslStream, SSL_VERIFY_PEER}; use pkey::PKeyRef; use version; Loading Loading @@ -91,7 +91,7 @@ impl SslConnectorBuilder { self } /// Consumes the builder, returning a `SslConnector`. /// Consumes the builder, returning an `SslConnector`. pub fn build(self) -> SslConnector { SslConnector(self.0.build()) } Loading Loading @@ -162,12 +162,14 @@ impl SslConnector { pub struct ConnectConfiguration(Ssl); impl ConnectConfiguration { /// Returns a shared reference to the inner `Ssl`. #[deprecated(since = "0.9.23", note = "ConnectConfiguration now implements Deref<Target=SslRef>")] pub fn ssl(&self) -> &Ssl { &self.0 } /// Returns a mutable reference to the inner `Ssl`. #[deprecated(since = "0.9.23", note = "ConnectConfiguration now implements DerefMut<Target=SslRef>")] pub fn ssl_mut(&mut self) -> &mut Ssl { &mut self.0 } Loading Loading @@ -207,6 +209,20 @@ impl ConnectConfiguration { } } impl Deref for ConnectConfiguration { type Target = SslRef; fn deref(&self) -> &SslRef { &self.0 } } impl DerefMut for ConnectConfiguration { fn deref_mut(&mut self) -> &mut SslRef { &mut self.0 } } /// A builder for `SslAcceptor`s. pub struct SslAcceptorBuilder(SslContextBuilder); Loading
openssl/src/ssl/error.rs +4 −1 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ use error::ErrorStack; use ssl::MidHandshakeSslStream; /// An SSL error. // FIXME this is missing variants #[derive(Debug)] pub enum Error { /// The SSL session has been closed by the other end Loading Loading @@ -100,7 +101,9 @@ pub enum HandshakeError<S> { SetupFailure(ErrorStack), /// The handshake failed. Failure(MidHandshakeSslStream<S>), /// The handshake was interrupted midway through. This error will never be returned for blocking streams. /// The handshake was interrupted midway through. /// /// This error will never be returned for blocking streams. // FIXME change to WouldBlock Interrupted(MidHandshakeSslStream<S>), } Loading
openssl/src/ssl/mod.rs +217 −45 File changed.Preview size limit exceeded, changes collapsed. Show changes