diff --git a/src/net.rs b/src/net.rs index d8fbd7a6..f93d00a8 100644 --- a/src/net.rs +++ b/src/net.rs @@ -471,6 +471,7 @@ mod openssl { impl super::SslClient for OpensslClient { type Stream = OpensslStream; + #[cfg(not(windows))] fn wrap_client(&self, stream: HttpStream, host: &str) -> ::Result { 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 { + 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 {