aboutsummaryrefslogtreecommitdiff
path: root/openssl/src/ssl/tests.rs
diff options
context:
space:
mode:
authorManuel Schölling <[email protected]>2015-08-14 20:16:10 +0200
committerManuel Schölling <[email protected]>2015-08-17 19:01:43 +0200
commit3fe3d57976664c76212ac9b8abcf876baeb3d1f3 (patch)
tree76f828dbd3ec223c8155ff00adbda4970950f69c /openssl/src/ssl/tests.rs
parentGrab errno for directstream want errors (diff)
downloadrust-openssl-3fe3d57976664c76212ac9b8abcf876baeb3d1f3.tar.xz
rust-openssl-3fe3d57976664c76212ac9b8abcf876baeb3d1f3.zip
Add get_state_string()
Diffstat (limited to 'openssl/src/ssl/tests.rs')
-rw-r--r--openssl/src/ssl/tests.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/openssl/src/ssl/tests.rs b/openssl/src/ssl/tests.rs
index 3a8ffa2b..9198a642 100644
--- a/openssl/src/ssl/tests.rs
+++ b/openssl/src/ssl/tests.rs
@@ -395,6 +395,14 @@ fn test_pending() {
assert_eq!(pending, len);
}
+#[test]
+fn test_state() {
+ let tcp = TcpStream::connect("127.0.0.1:15418").unwrap();
+ let stream = SslStream::connect_generic(&SslContext::new(Sslv23).unwrap(), tcp).unwrap();
+ assert_eq!(stream.get_state_string(), "SSLOK ");
+ assert_eq!(stream.get_state_string_long(), "SSL negotiation finished successfully");
+}
+
/// Tests that connecting with the client using NPN, but the server not does not
/// break the existing connection behavior.
#[test]