@@ -156,27 +156,27 @@ async def test_connection(self):
156
156
157
157
async def test_set_server_hostname_implicitly (self ):
158
158
"""Client sets server_hostname to the host in the WebSocket URI."""
159
- with temp_unix_socket_path () as path :
160
- async with run_unix_server (path , ssl = SERVER_CONTEXT ):
161
- async with run_unix_client (
162
- path ,
163
- ssl = CLIENT_CONTEXT ,
164
- uri = "wss://overridden/" ,
165
- ) as client :
166
- ssl_object = client .transport .get_extra_info ("ssl_object" )
167
- self .assertEqual (ssl_object .server_hostname , "overridden" )
159
+ async with run_server (ssl = SERVER_CONTEXT ) as server :
160
+ host , port = get_server_host_port (server )
161
+ async with run_client (
162
+ "wss://overridden/" ,
163
+ host = host ,
164
+ port = port ,
165
+ ssl = CLIENT_CONTEXT ,
166
+ ) as client :
167
+ ssl_object = client .transport .get_extra_info ("ssl_object" )
168
+ self .assertEqual (ssl_object .server_hostname , "overridden" )
168
169
169
170
async def test_set_server_hostname_explicitly (self ):
170
171
"""Client sets server_hostname to the value provided in argument."""
171
- with temp_unix_socket_path () as path :
172
- async with run_unix_server (path , ssl = SERVER_CONTEXT ):
173
- async with run_unix_client (
174
- path ,
175
- ssl = CLIENT_CONTEXT ,
176
- server_hostname = "overridden" ,
177
- ) as client :
178
- ssl_object = client .transport .get_extra_info ("ssl_object" )
179
- self .assertEqual (ssl_object .server_hostname , "overridden" )
172
+ async with run_server (ssl = SERVER_CONTEXT ) as server :
173
+ async with run_client (
174
+ server ,
175
+ ssl = CLIENT_CONTEXT ,
176
+ server_hostname = "overridden" ,
177
+ ) as client :
178
+ ssl_object = client .transport .get_extra_info ("ssl_object" )
179
+ self .assertEqual (ssl_object .server_hostname , "overridden" )
180
180
181
181
async def test_reject_invalid_server_certificate (self ):
182
182
"""Client rejects certificate where server certificate isn't trusted."""
0 commit comments