Merge pull request #795 from hyperium/794-windows-no-verify
fix(windows): disable openssl cert validation for Windows
This commit is contained in:
		
							
								
								
									
										11
									
								
								src/net.rs
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								src/net.rs
									
									
									
									
									
								
							| @@ -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)); | ||||
| @@ -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 { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user