Skip to content

Commit 5859eba

Browse files
committed
test: add client -> example.com test
This commit adds a unit test that uses the client test binary to connect to https://example.com, validating the presented certificate chain using the system default CA bundle. We do this with `NO_ECHO=1` to avoid trying to write a non-HTTP request and asserting on an echoed response.
1 parent 150435f commit 5859eba

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

rustls-libssl/tests/runner.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,29 @@ fn client() {
8888
assert_eq!(openssl_secure_output, rustls_secure_output);
8989
}
9090

91+
#[test]
92+
#[ignore]
93+
fn client_real_world() {
94+
let openssl_output = Command::new("tests/maybe-valgrind.sh")
95+
.env("LD_LIBRARY_PATH", "")
96+
.env("NO_ECHO", "1")
97+
.args(&["target/client", "example.com", "443", "default"])
98+
.stdout(Stdio::piped())
99+
.output()
100+
.map(print_output)
101+
.unwrap();
102+
103+
let rustls_output = Command::new("tests/maybe-valgrind.sh")
104+
.env("NO_ECHO", "1")
105+
.args(&["target/client", "example.com", "443", "default"])
106+
.stdout(Stdio::piped())
107+
.output()
108+
.map(print_output)
109+
.unwrap();
110+
111+
assert_eq!(openssl_output, rustls_output);
112+
}
113+
91114
#[test]
92115
#[ignore]
93116
fn constants() {

0 commit comments

Comments
 (0)