@@ -46,7 +46,7 @@ my $id = $loop->server(
46
46
my $port = $loop -> acceptor($id )-> port;
47
47
my $promise2 = Mojo::Promise-> new-> ioloop($loop );
48
48
$loop -> client(
49
- {port => $port , tls => 1, tls_options => {SSL_verify_mode => 0x00}} => sub {
49
+ {address => ' localhost ' , port => $port , tls => 1, tls_options => {SSL_verify_mode => 0x00}} => sub {
50
50
my ($loop , $err , $stream ) = @_ ;
51
51
$stream -> write (' tset' => sub { shift -> write (' 123' ) });
52
52
$stream -> on(close => sub { $promise2 -> resolve });
@@ -88,6 +88,7 @@ $id = Mojo::IOLoop->server(
88
88
$port = Mojo::IOLoop-> acceptor($id )-> port;
89
89
$promise2 = Mojo::Promise-> new;
90
90
Mojo::IOLoop-> client(
91
+ address => ' localhost' ,
91
92
port => $port ,
92
93
tls => 1,
93
94
tls_cert => ' t/mojo/certs/client.crt' ,
@@ -118,6 +119,7 @@ ok !$server_err, 'no error';
118
119
# Invalid client certificate
119
120
my $client_err ;
120
121
Mojo::IOLoop-> client(
122
+ address => ' localhost' ,
121
123
port => $port ,
122
124
tls => 1,
123
125
tls_cert => ' t/mojo/certs/bad.crt' ,
@@ -133,7 +135,7 @@ ok $client_err, 'has error';
133
135
# Missing client certificate
134
136
($server_err , $client_err ) = ();
135
137
Mojo::IOLoop-> client(
136
- {port => $port , tls => 1} => sub {
138
+ {address => ' localhost ' , port => $port , tls => 1} => sub {
137
139
shift -> stop;
138
140
$client_err = shift ;
139
141
}
@@ -155,6 +157,7 @@ $id = $loop->server(
155
157
);
156
158
$port = $loop -> acceptor($id )-> port;
157
159
$loop -> client(
160
+ address => ' localhost' ,
158
161
port => $port ,
159
162
tls => 1,
160
163
tls_cert => ' t/mojo/certs/client.crt' ,
@@ -195,6 +198,7 @@ $id = Mojo::IOLoop->server(
195
198
$port = Mojo::IOLoop-> acceptor($id )-> port;
196
199
$promise2 = Mojo::Promise-> new;
197
200
Mojo::IOLoop-> client(
201
+ address => ' localhost' ,
198
202
port => $port ,
199
203
tls => 1,
200
204
tls_ca => ' t/mojo/certs/ca.crt' ,
@@ -235,9 +239,10 @@ $id = $loop->server(
235
239
);
236
240
$port = $loop -> acceptor($id )-> port;
237
241
$loop -> client(
238
- port => $port ,
239
- tls => 1,
240
- tls_ca => ' t/mojo/certs/ca.crt' ,
242
+ address => ' localhost' ,
243
+ port => $port ,
244
+ tls => 1,
245
+ tls_ca => ' t/mojo/certs/ca.crt' ,
241
246
sub {
242
247
shift -> stop;
243
248
$client_err = shift ;
@@ -259,6 +264,7 @@ $id = $loop->server(
259
264
);
260
265
$port = $loop -> acceptor($id )-> port;
261
266
$loop -> client(
267
+ address => ' localhost' ,
262
268
port => $port ,
263
269
tls => 1,
264
270
tls_ca => ' t/mojo/certs/ca.crt' ,
@@ -283,9 +289,10 @@ $id = $loop->server(
283
289
);
284
290
$port = $loop -> acceptor($id )-> port;
285
291
$loop -> client(
286
- port => $port ,
287
- tls => 1,
288
- tls_ca => ' no cert' ,
292
+ address => ' localhost' ,
293
+ port => $port ,
294
+ tls => 1,
295
+ tls_ca => ' no cert' ,
289
296
sub {
290
297
shift -> stop;
291
298
$client_err = shift ;
@@ -314,6 +321,7 @@ $id = $loop->server(
314
321
);
315
322
$port = $loop -> acceptor($id )-> port;
316
323
$loop -> client(
324
+ address => ' localhost' ,
317
325
port => $port ,
318
326
tls => 1,
319
327
tls_cert => ' t/mojo/certs/bad.crt' ,
@@ -349,7 +357,7 @@ $id = Mojo::IOLoop->server(
349
357
);
350
358
$port = Mojo::IOLoop-> acceptor($id )-> port;
351
359
Mojo::IOLoop-> client(
352
- {port => $port , tls => 1, tls_options => {SSL_verify_mode => 0x00}} => sub {
360
+ {address => ' localhost ' , port => $port , tls => 1, tls_options => {SSL_verify_mode => 0x00}} => sub {
353
361
shift -> stop;
354
362
$client = ' connected' ;
355
363
$client_err = shift ;
@@ -375,6 +383,7 @@ subtest 'ALPN' => sub {
375
383
);
376
384
$port = Mojo::IOLoop-> acceptor($id )-> port;
377
385
Mojo::IOLoop-> client(
386
+ address => ' localhost' ,
378
387
port => $port ,
379
388
tls => 1,
380
389
tls_options => {SSL_alpn_protocols => [' baz' , ' bar' ], SSL_verify_mode => 0x00},
0 commit comments