Skip to content

Commit c89aca8

Browse files
committed
fix(windows): disable openssl cert validation for Windows
It doesn't work, so it's just causing errors. Closes #794
1 parent 3c0e105 commit c89aca8

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/net.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -671,13 +671,22 @@ mod openssl {
671671
impl<T: NetworkStream + Send + Clone> super::SslClient<T> for OpensslClient {
672672
type Stream = SslStream<T>;
673673

674+
#[cfg(not(windows))]
674675
fn wrap_client(&self, stream: T, host: &str) -> ::Result<Self::Stream> {
675676
let mut ssl = try!(Ssl::new(&self.0));
676677
try!(ssl.set_hostname(host));
677678
let host = host.to_owned();
678679
ssl.set_verify_callback(SSL_VERIFY_PEER, move |p, x| ::openssl_verify::verify_callback(&host, p, x));
679680
SslStream::connect(ssl, stream).map_err(From::from)
680681
}
682+
683+
684+
#[cfg(windows)]
685+
fn wrap_client(&self, stream: T, host: &str) -> ::Result<Self::Stream> {
686+
let mut ssl = try!(Ssl::new(&self.0));
687+
try!(ssl.set_hostname(host));
688+
SslStream::connect(ssl, stream).map_err(From::from)
689+
}
681690
}
682691

683692
impl Default for Openssl {

0 commit comments

Comments
 (0)