Allow all of SSL2, SSL3 and TLS1 connections

This commit is contained in:
Perl I. Weird 2017-04-01 13:22:25 -07:00 committed by GitHub
parent d68e998f44
commit 2da5f4defc

View file

@ -92,7 +92,7 @@ impl NetConnection {
#[cfg(feature = "ssl")] #[cfg(feature = "ssl")]
fn connect_ssl_internal(host: &str, port: u16) -> Result<NetReadWritePair> { fn connect_ssl_internal(host: &str, port: u16) -> Result<NetReadWritePair> {
let socket = try!(TcpStream::connect(&format!("{}:{}", host, port)[..])); let socket = try!(TcpStream::connect(&format!("{}:{}", host, port)[..]));
let ssl = try!(ssl_to_io(SslContext::new(SslMethod::Tlsv1))); let ssl = try!(ssl_to_io(SslContext::new(SslMethod::Sslv23)));
let ssl_socket = try!(ssl_to_io(SslStream::connect_generic(&ssl, socket))); let ssl_socket = try!(ssl_to_io(SslStream::connect_generic(&ssl, socket)));
Ok((BufReader::new(NetStream::Ssl(try!(ssl_socket.try_clone()))), Ok((BufReader::new(NetStream::Ssl(try!(ssl_socket.try_clone()))),
BufWriter::new(NetStream::Ssl(ssl_socket)))) BufWriter::new(NetStream::Ssl(ssl_socket))))