@@ -42,12 +42,16 @@ fn client_server_integration() {
42
42
client_tests : vec ! [
43
43
ClientTest {
44
44
name: "No client auth" ,
45
+ host: HOST ,
46
+ port: PORT ,
45
47
valgrind: valgrind. clone( ) ,
46
48
env: vec![ ( "CA_FILE" , "testdata/minica.pem" ) ] ,
47
49
expect_error: true , // Client connecting w/o AUTH_CERT/AUTH_KEY should err.
48
50
} ,
49
51
ClientTest {
50
52
name: "Valid client auth" ,
53
+ host: HOST ,
54
+ port: PORT ,
51
55
valgrind: valgrind. clone( ) ,
52
56
env: vec![
53
57
( "CA_FILE" , "testdata/minica.pem" ) ,
@@ -71,6 +75,8 @@ fn client_server_integration() {
71
75
client_tests : vec ! [
72
76
ClientTest {
73
77
name: "Valid client auth" ,
78
+ host: HOST ,
79
+ port: PORT ,
74
80
valgrind: valgrind. clone( ) ,
75
81
env: vec![
76
82
( "CA_FILE" , "testdata/minica.pem" ) ,
@@ -81,6 +87,8 @@ fn client_server_integration() {
81
87
} ,
82
88
ClientTest {
83
89
name: "Revoked client auth" ,
90
+ host: HOST ,
91
+ port: PORT ,
84
92
valgrind: valgrind. clone( ) ,
85
93
env: vec![
86
94
( "CA_FILE" , "testdata/minica.pem" ) ,
@@ -105,30 +113,40 @@ fn standard_client_tests(valgrind: Option<String>) -> Vec<ClientTest> {
105
113
vec ! [
106
114
ClientTest {
107
115
name: "rustls-platform-verifier" ,
116
+ host: HOST ,
117
+ port: PORT ,
108
118
valgrind: valgrind. clone( ) ,
109
119
env: vec![ ( "RUSTLS_PLATFORM_VERIFIER" , "1" ) ] ,
110
120
expect_error: true ,
111
121
} ,
112
122
ClientTest {
113
123
name: "With CA_FILE" ,
124
+ host: HOST ,
125
+ port: PORT ,
114
126
valgrind: valgrind. clone( ) ,
115
127
env: vec![ ( "CA_FILE" , "testdata/minica.pem" ) ] ,
116
128
expect_error: false ,
117
129
} ,
118
130
ClientTest {
119
131
name: "No certificate validation" ,
132
+ host: HOST ,
133
+ port: PORT ,
120
134
valgrind: valgrind. clone( ) ,
121
135
env: vec![ ( "NO_CHECK_CERTIFICATE" , "1" ) ] ,
122
136
expect_error: false ,
123
137
} ,
124
138
ClientTest {
125
139
name: "Client Vectored I/O" ,
140
+ host: HOST ,
141
+ port: PORT ,
126
142
valgrind: valgrind. clone( ) ,
127
143
env: vec![ ( "CA_FILE" , "testdata/minica.pem" ) , ( "USE_VECTORED" , "1" ) ] ,
128
144
expect_error: false ,
129
145
} ,
130
146
ClientTest {
131
147
name: "Client authentication" ,
148
+ host: HOST ,
149
+ port: PORT ,
132
150
valgrind: valgrind. clone( ) ,
133
151
env: vec![
134
152
( "CA_FILE" , "testdata/minica.pem" ) ,
@@ -142,6 +160,8 @@ fn standard_client_tests(valgrind: Option<String>) -> Vec<ClientTest> {
142
160
143
161
struct ClientTest {
144
162
name : & ' static str ,
163
+ host : & ' static str ,
164
+ port : & ' static str ,
145
165
valgrind : Option < String > ,
146
166
env : Vec < ( & ' static str , & ' static str ) > ,
147
167
expect_error : bool ,
@@ -150,7 +170,7 @@ struct ClientTest {
150
170
impl ClientTest {
151
171
fn run ( & self ) {
152
172
let client_binary = client_binary ( ) ;
153
- let args = vec ! [ HOST , PORT , "/" ] ;
173
+ let args = vec ! [ self . host , self . port , "/" ] ;
154
174
let ( program, args) = match & self . valgrind {
155
175
None => ( client_binary. as_str ( ) , args) ,
156
176
Some ( valgrind) => (
@@ -232,6 +252,20 @@ impl TestCase {
232
252
}
233
253
}
234
254
255
+ #[ test]
256
+ #[ ignore] // This test requires the client binary be present.
257
+ fn platform_verifier ( ) {
258
+ ClientTest {
259
+ name : "Platform verifier to example.com" ,
260
+ host : "example.com" ,
261
+ port : "443" ,
262
+ valgrind : env:: var ( "VALGRIND" ) . ok ( ) ,
263
+ env : vec ! [ ( "RUSTLS_PLATFORM_VERIFIER" , "1" ) ] ,
264
+ expect_error : false ,
265
+ }
266
+ . run ( ) ;
267
+ }
268
+
235
269
fn client_binary ( ) -> String {
236
270
let custom_client_binary = env:: var ( "CLIENT_BINARY" ) . ok ( ) ;
237
271
#[ cfg( not( target_os = "windows" ) ) ]
0 commit comments