Fix errors in tests (SslVerifyPeer -> SSL_VERIFY_PEER)

This commit is contained in:
Manuel Schölling 2015-04-03 14:47:25 +02:00
parent 57f046e8ea
commit 7e88d8c277
1 changed files with 16 additions and 16 deletions

View File

@ -258,11 +258,11 @@ fn test_read() {
fn test_connect_with_unilateral_npn() { fn test_connect_with_unilateral_npn() {
let stream = TcpStream::connect("127.0.0.1:15418").unwrap(); let stream = TcpStream::connect("127.0.0.1:15418").unwrap();
let mut ctx = SslContext::new(Sslv23).unwrap(); let mut ctx = SslContext::new(Sslv23).unwrap();
ctx.set_verify(SslVerifyPeer, None); ctx.set_verify(SSL_VERIFY_PEER, None);
ctx.set_npn_protocols(&[b"http/1.1", b"spdy/3.1"]); ctx.set_npn_protocols(&[b"http/1.1", b"spdy/3.1"]);
match ctx.set_CA_file(&Path::new("test/cert.pem")) { match ctx.set_CA_file(&Path::new("test/cert.pem")) {
None => {} Ok(_)=> {}
Some(err) => panic!("Unexpected error {:?}", err) Err(err) => panic!("Unexpected error {:?}", err)
} }
let stream = match SslStream::new(&ctx, stream) { let stream = match SslStream::new(&ctx, stream) {
Ok(stream) => stream, Ok(stream) => stream,
@ -282,11 +282,11 @@ fn test_connect_with_npn_successful_multiple_matching() {
// NPN enabled. // NPN enabled.
let stream = TcpStream::connect("127.0.0.1:15419").unwrap(); let stream = TcpStream::connect("127.0.0.1:15419").unwrap();
let mut ctx = SslContext::new(Sslv23).unwrap(); let mut ctx = SslContext::new(Sslv23).unwrap();
ctx.set_verify(SslVerifyPeer, None); ctx.set_verify(SSL_VERIFY_PEER, None);
ctx.set_npn_protocols(&[b"spdy/3.1", b"http/1.1"]); ctx.set_npn_protocols(&[b"spdy/3.1", b"http/1.1"]);
match ctx.set_CA_file(&Path::new("test/cert.pem")) { match ctx.set_CA_file(&Path::new("test/cert.pem")) {
None => {} Ok(_)=> {}
Some(err) => panic!("Unexpected error {:?}", err) Err(err) => panic!("Unexpected error {:?}", err)
} }
let stream = match SslStream::new(&ctx, stream) { let stream = match SslStream::new(&ctx, stream) {
Ok(stream) => stream, Ok(stream) => stream,
@ -307,11 +307,11 @@ fn test_connect_with_npn_successful_single_match() {
// NPN enabled. // NPN enabled.
let stream = TcpStream::connect("127.0.0.1:15419").unwrap(); let stream = TcpStream::connect("127.0.0.1:15419").unwrap();
let mut ctx = SslContext::new(Sslv23).unwrap(); let mut ctx = SslContext::new(Sslv23).unwrap();
ctx.set_verify(SslVerifyPeer, None); ctx.set_verify(SSL_VERIFY_PEER, None);
ctx.set_npn_protocols(&[b"spdy/3.1"]); ctx.set_npn_protocols(&[b"spdy/3.1"]);
match ctx.set_CA_file(&Path::new("test/cert.pem")) { match ctx.set_CA_file(&Path::new("test/cert.pem")) {
None => {} Ok(_)=> {}
Some(err) => panic!("Unexpected error {:?}", err) Err(err) => panic!("Unexpected error {:?}", err)
} }
let stream = match SslStream::new(&ctx, stream) { let stream = match SslStream::new(&ctx, stream) {
Ok(stream) => stream, Ok(stream) => stream,
@ -332,12 +332,12 @@ fn test_npn_server_advertise_multiple() {
// We create a different context instance for the server... // We create a different context instance for the server...
let listener_ctx = { let listener_ctx = {
let mut ctx = SslContext::new(Sslv23).unwrap(); let mut ctx = SslContext::new(Sslv23).unwrap();
ctx.set_verify(SslVerifyPeer, None); ctx.set_verify(SSL_VERIFY_PEER, None);
ctx.set_npn_protocols(&[b"http/1.1", b"spdy/3.1"]); ctx.set_npn_protocols(&[b"http/1.1", b"spdy/3.1"]);
ctx.set_certificate_file( assert!(ctx.set_certificate_file(
&Path::new("test/cert.pem"), X509FileType::PEM); &Path::new("test/cert.pem"), X509FileType::PEM).is_ok());
ctx.set_private_key_file( ctx.set_private_key_file(
&Path::new("test/key.pem"), X509FileType::PEM); &Path::new("test/key.pem"), X509FileType::PEM).unwrap();
ctx ctx
}; };
// Have the listener wait on the connection in a different thread. // Have the listener wait on the connection in a different thread.
@ -347,11 +347,11 @@ fn test_npn_server_advertise_multiple() {
}); });
let mut ctx = SslContext::new(Sslv23).unwrap(); let mut ctx = SslContext::new(Sslv23).unwrap();
ctx.set_verify(SslVerifyPeer, None); ctx.set_verify(SSL_VERIFY_PEER, None);
ctx.set_npn_protocols(&[b"spdy/3.1"]); ctx.set_npn_protocols(&[b"spdy/3.1"]);
match ctx.set_CA_file(&Path::new("test/cert.pem")) { match ctx.set_CA_file(&Path::new("test/cert.pem")) {
None => {} Ok(_)=> {}
Some(err) => panic!("Unexpected error {:?}", err) Err(err) => panic!("Unexpected error {:?}", err)
} }
// Now connect to the socket and make sure the protocol negotiation works... // Now connect to the socket and make sure the protocol negotiation works...
let stream = TcpStream::connect(localhost).unwrap(); let stream = TcpStream::connect(localhost).unwrap();