diff --git a/openssl/src/ssl/mod.rs b/openssl/src/ssl/mod.rs index 92e0c159..3327ff22 100644 --- a/openssl/src/ssl/mod.rs +++ b/openssl/src/ssl/mod.rs @@ -1254,6 +1254,11 @@ impl MidHandshakeSslStream { &self.error } + /// Consumes `self`, returning its error. + pub fn into_error(self) -> Error { + self.error + } + /// Restarts the handshake process. pub fn handshake(mut self) -> Result, HandshakeError> { let ret = unsafe { ffi::SSL_do_handshake(self.stream.ssl.as_ptr()) };