diff options
| author | Steven Fackler <[email protected]> | 2015-06-25 23:07:25 -0700 |
|---|---|---|
| committer | Steven Fackler <[email protected]> | 2015-06-25 23:07:25 -0700 |
| commit | 212acf0bb8fa6f500c76329ddb15e7f989e71915 (patch) | |
| tree | 9a48cfb865174b86972cfb6b690f6457aad32830 /openssl/src | |
| parent | Fix EOF handling in retry wrapper (diff) | |
| download | rust-openssl-212acf0bb8fa6f500c76329ddb15e7f989e71915.tar.xz rust-openssl-212acf0bb8fa6f500c76329ddb15e7f989e71915.zip | |
Add a test for connection negotiation failure
Diffstat (limited to 'openssl/src')
| -rw-r--r-- | openssl/src/ssl/tests.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/openssl/src/ssl/tests.rs b/openssl/src/ssl/tests.rs index 028d9f09..dcaee215 100644 --- a/openssl/src/ssl/tests.rs +++ b/openssl/src/ssl/tests.rs @@ -23,6 +23,8 @@ use crypto::pkey::PKey; use std::net::UdpSocket; #[cfg(feature="dtlsv1")] use ssl::SslMethod::Dtlsv1; +#[cfg(feature="sslv2")] +use ssl::SslMethod::Sslv2; #[cfg(feature="dtlsv1")] use connected_socket::Connect; @@ -447,7 +449,7 @@ fn test_connect_with_npn_successful_single_match() { #[test] #[cfg(feature = "npn")] fn test_npn_server_advertise_multiple() { - let localhost = "127.0.0.1:15420"; + let localhost = "127.0.0.1:15450"; let listener = TcpListener::bind(localhost).unwrap(); // We create a different context instance for the server... let listener_ctx = { @@ -516,3 +518,10 @@ fn test_read_dtlsv1() { let mut buf = [0u8;100]; assert!(stream.read(&mut buf).is_ok()); } + +#[test] +#[cfg(feature = "sslv2")] +fn test_sslv2_connect_failure() { + let tcp = TcpStream::connect("127.0.0.1:15420").unwrap(); + SslStream::new(&SslContext::new(Sslv2).unwrap(), tcp).err().unwrap(); +} |