From c89aca812bf863aadb52326f534a65c1d3cf31d6 Mon Sep 17 00:00:00 2001 From: Sean McArthur Date: Tue, 17 May 2016 12:58:11 -0700 Subject: [PATCH] fix(windows): disable openssl cert validation for Windows It doesn't work, so it's just causing errors. Closes #794 --- src/net.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/net.rs b/src/net.rs index 0bcb12f4db..640b70ce4e 100644 --- a/src/net.rs +++ b/src/net.rs @@ -671,6 +671,7 @@ mod openssl { impl super::SslClient for OpensslClient { type Stream = SslStream; + #[cfg(not(windows))] fn wrap_client(&self, stream: T, host: &str) -> ::Result { let mut ssl = try!(Ssl::new(&self.0)); try!(ssl.set_hostname(host)); @@ -678,6 +679,14 @@ mod openssl { ssl.set_verify_callback(SSL_VERIFY_PEER, move |p, x| ::openssl_verify::verify_callback(&host, p, x)); SslStream::connect(ssl, stream).map_err(From::from) } + + + #[cfg(windows)] + fn wrap_client(&self, stream: T, host: &str) -> ::Result { + let mut ssl = try!(Ssl::new(&self.0)); + try!(ssl.set_hostname(host)); + SslStream::connect(ssl, stream).map_err(From::from) + } } impl Default for Openssl {