diff options
| author | Steven Fackler <[email protected]> | 2015-12-09 22:02:02 -0800 |
|---|---|---|
| committer | Steven Fackler <[email protected]> | 2015-12-09 22:02:02 -0800 |
| commit | 8f56897043f8138980ce3376765b769c764d8701 (patch) | |
| tree | acb10fdbf1dccbaa62c2e7024f54e8a38146d37f /openssl/src/ssl/tests | |
| parent | IT LIVES (diff) | |
| download | rust-openssl-8f56897043f8138980ce3376765b769c764d8701.tar.xz rust-openssl-8f56897043f8138980ce3376765b769c764d8701.zip | |
Implement read and write
Diffstat (limited to 'openssl/src/ssl/tests')
| -rw-r--r-- | openssl/src/ssl/tests/mod.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/openssl/src/ssl/tests/mod.rs b/openssl/src/ssl/tests/mod.rs index d1f34019..13d9371c 100644 --- a/openssl/src/ssl/tests/mod.rs +++ b/openssl/src/ssl/tests/mod.rs @@ -936,3 +936,15 @@ fn ng_connect() { let ctx = SslContext::new(Sslv23).unwrap(); SslStreamNg::connect(&ctx, stream).unwrap(); } + +#[test] +fn ng_get() { + let (_s, stream) = Server::new(); + let ctx = SslContext::new(Sslv23).unwrap(); + let mut stream = SslStreamNg::connect(&ctx, stream).unwrap(); + stream.write_all(b"GET / HTTP/1.0\r\n\r\n").unwrap(); + let mut resp = String::new(); + stream.read_to_string(&mut resp).unwrap(); + assert!(resp.starts_with("HTTP/1.0 200")); + assert!(resp.ends_with("</HTML>\r\n\r\n")); +} |