fix(windows): disable openssl cert validation for Windows

It doesn't work, so it's just causing errors.

Closes #794
This commit is contained in:
Sean McArthur
2016-05-17 12:58:11 -07:00
parent 5c1ecfb95f
commit c81deed3e6

View File

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