Merge pull request #795 from hyperium/794-windows-no-verify

fix(windows): disable openssl cert validation for Windows
This commit is contained in:
Sean McArthur
2016-05-18 11:19:43 -07:00

View File

@@ -471,6 +471,7 @@ mod openssl {
impl super::SslClient for OpensslClient {
type Stream = OpensslStream<HttpStream>;
#[cfg(not(windows))]
fn wrap_client(&self, stream: HttpStream, host: &str) -> ::Result<Self::Stream> {
let mut ssl = try!(Ssl::new(&self.0));
try!(ssl.set_hostname(host));
@@ -480,6 +481,16 @@ mod openssl {
.map(openssl_stream)
.map_err(From::from)
}
#[cfg(windows)]
fn wrap_client(&self, stream: HttpStream, host: &str) -> ::Result<Self::Stream> {
let mut ssl = try!(Ssl::new(&self.0));
try!(ssl.set_hostname(host));
SslStream::connect(ssl, stream)
.map(openssl_stream)
.map_err(From::from)
}
}
impl Default for Openssl {