Skip to content

Commit

Permalink
rollback localhost => 127.0.0.1 change for servers
Browse files Browse the repository at this point in the history
  • Loading branch information
lgv5 committed Mar 9, 2023
1 parent 4689b47 commit dcd4fd5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
20 changes: 10 additions & 10 deletions t/mojo/ioloop_tls.t
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ utf8::upgrade $upgraded;
my ($server, $client);
my $promise = Mojo::Promise->new->ioloop($loop);
my $id = $loop->server(
{address => 'localhost', tls => 1} => sub {
{address => '127.0.0.1', tls => 1} => sub {
my ($loop, $stream) = @_;
$stream->write($upgraded => sub { shift->write('321') });
$stream->on(close => sub { $promise->resolve });
Expand Down Expand Up @@ -64,7 +64,7 @@ my ($remove, $running, $timeout, $server_err, $server_close, $client_close);
Mojo::IOLoop->remove(Mojo::IOLoop->recurring(0 => sub { $remove++ }));
$promise = Mojo::Promise->new;
$id = Mojo::IOLoop->server(
address => 'localhost',
address => '127.0.0.1',
tls => 1,
tls_ca => 't/mojo/certs/ca.crt',
tls_cert => 't/mojo/certs/server.crt',
Expand Down Expand Up @@ -148,7 +148,7 @@ ok $client_err, 'has error';
$loop = Mojo::IOLoop->new;
($server_err, $client_err) = ();
$id = $loop->server(
address => 'localhost',
address => '127.0.0.1',
tls => 1,
tls_ca => 'no cert',
tls_cert => 't/mojo/certs/server.crt',
Expand Down Expand Up @@ -176,7 +176,7 @@ ok $client_err, 'has error';
($client, $client_close) = ();
$promise = Mojo::Promise->new;
$id = Mojo::IOLoop->server(
address => 'localhost',
address => '127.0.0.1',
tls => 1,
tls_ca => 't/mojo/certs/ca.crt',
tls_cert => 't/mojo/certs/server.crt',
Expand Down Expand Up @@ -231,7 +231,7 @@ ok !$server_err, 'no error';
$loop = Mojo::IOLoop->new;
($server_err, $client_err) = ();
$id = $loop->server(
address => 'localhost',
address => '127.0.0.1',
tls => 1,
tls_cert => 't/mojo/certs/bad.crt',
tls_key => 't/mojo/certs/bad.key',
Expand All @@ -256,7 +256,7 @@ ok $client_err, 'has error';
$loop = Mojo::IOLoop->new;
($server_err, $client_err) = ();
$id = $loop->server(
address => 'localhost',
address => '127.0.0.1',
tls => 1,
tls_cert => 't/mojo/certs/bad.crt',
tls_key => 't/mojo/certs/bad.key',
Expand All @@ -281,7 +281,7 @@ ok $client_err, 'has error';
$loop = Mojo::IOLoop->new;
($server_err, $client_err) = ();
$id = $loop->server(
address => 'localhost',
address => '127.0.0.1',
tls => 1,
tls_cert => 't/mojo/certs/bad.crt',
tls_key => 't/mojo/certs/bad.key',
Expand All @@ -307,7 +307,7 @@ $loop = Mojo::IOLoop->new;
my ($cipher, $version);
($server, $client, $client_err) = ();
$id = $loop->server(
address => 'localhost',
address => '127.0.0.1',
tls => 1,
tls_ca => 't/mojo/certs/ca.crt',
tls_cert => 't/mojo/certs/server.crt',
Expand Down Expand Up @@ -347,7 +347,7 @@ is $cipher, $expect, "$expect has been negotiatied";
# Ignore missing client certificate
($server, $client, $client_err) = ();
$id = Mojo::IOLoop->server(
address => 'localhost',
address => '127.0.0.1',
tls => 1,
tls_ca => 't/mojo/certs/ca.crt',
tls_cert => 't/mojo/certs/server.crt',
Expand All @@ -372,7 +372,7 @@ subtest 'ALPN' => sub {
plan skip_all => 'ALPN support required!' unless IO::Socket::SSL->can_alpn;
my ($server_proto, $client_proto);
$id = Mojo::IOLoop->server(
address => 'localhost',
address => '127.0.0.1',
tls => 1,
tls_options => {SSL_alpn_protocols => ['foo', 'bar', 'baz']},
sub {
Expand Down
6 changes: 3 additions & 3 deletions t/mojo/user_agent_tls.t
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ get '/' => {text => 'works!'};
subtest 'Web server with valid certificates' => sub {
my $daemon = Mojo::Server::Daemon->new(app => app, ioloop => Mojo::IOLoop->singleton, silent => 1);
my $listen
= 'https://localhost'
= 'https://127.0.0.1'
. '?cert=t/mojo/certs/server.crt'
. '&key=t/mojo/certs/server.key'
. '&ca=t/mojo/certs/ca.crt&verify=0x03';
Expand Down Expand Up @@ -76,7 +76,7 @@ subtest 'Web server with valid certificates' => sub {
subtest 'Web server with valid certificates and no verification' => sub {
my $daemon = Mojo::Server::Daemon->new(app => app, ioloop => Mojo::IOLoop->singleton, silent => 1);
my $listen
= 'https://localhost'
= 'https://127.0.0.1'
. '?cert=t/mojo/certs/server.crt'
. '&key=t/mojo/certs/server.key'
. '&ca=t/mojo/certs/ca.crt'
Expand All @@ -100,7 +100,7 @@ subtest 'Web server with valid certificates and no verification' => sub {

subtest 'Client side TLS options' => sub {
my $daemon = Mojo::Server::Daemon->new(app => app, ioloop => Mojo::IOLoop->singleton, silent => 1);
my $listen = 'https://localhost/?version=TLSv1_1';
my $listen = 'https://127.0.0.1/?version=TLSv1_1';
my $port = $daemon->listen([$listen])->start->ports->[0];

subtest '(Not) setting verification mode' => sub {
Expand Down
2 changes: 1 addition & 1 deletion t/mojo/websocket_proxy_tls.t
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ websocket '/test' => sub {
# Web server with valid certificates
my $daemon = Mojo::Server::Daemon->new(app => app, silent => 1);
my $listen
= 'https://localhost' . '?cert=t/mojo/certs/server.crt' . '&key=t/mojo/certs/server.key' . '&ca=t/mojo/certs/ca.crt';
= 'https://127.0.0.1' . '?cert=t/mojo/certs/server.crt' . '&key=t/mojo/certs/server.key' . '&ca=t/mojo/certs/ca.crt';
my $port = $daemon->listen([$listen])->start->ports->[0];

# Connect proxy server for testing
Expand Down

0 comments on commit dcd4fd5

Please sign in to comment.