Skip to content

Commit

Permalink
fix(windows): disable openssl cert validation for Windows
Browse files Browse the repository at this point in the history
It doesn't work, so it's just causing errors.

Closes #794
  • Loading branch information
seanmonstar committed May 18, 2016
1 parent 5c1ecfb commit c81deed
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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 {
Expand Down

0 comments on commit c81deed

Please sign in to comment.