Skip to content

Commit 6f31727

Browse files
committed
Adjust TLS version for LibreSSL deprecation of TLSv1.1 and older
1 parent 06c5bb0 commit 6f31727

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

t/mojo/user_agent_tls.t

+9-5
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ subtest 'Web server with valid certificates and no verification' => sub {
8282
. '&ca=t/mojo/certs/ca.crt'
8383
. '&ciphers=AES256-SHA:ALL'
8484
. '&verify=0x00'
85-
. '&version=TLSv1';
85+
. '&version=TLSv1_2';
8686
my $port = $daemon->listen([$listen])->start->ports->[0];
8787

8888
# Invalid certificate
@@ -95,12 +95,16 @@ subtest 'Web server with valid certificates and no verification' => sub {
9595
$tx = $ua->get("https://localhost:$port");
9696
ok !$tx->error, 'no error';
9797
is $ua->ioloop->stream($tx->connection)->handle->get_cipher, 'AES256-SHA', 'AES256-SHA has been negotiatied';
98-
is $ua->ioloop->stream($tx->connection)->handle->get_sslversion, 'TLSv1', 'TLSv1 has been negotiatied';
98+
is $ua->ioloop->stream($tx->connection)->handle->get_sslversion, 'TLSv1_2', 'TLSv1.2 has been negotiatied';
9999
};
100100

101101
subtest 'Client side TLS options' => sub {
102102
my $daemon = Mojo::Server::Daemon->new(app => app, ioloop => Mojo::IOLoop->singleton, silent => 1);
103-
my $listen = 'https://127.0.0.1/?version=TLSv1_1';
103+
my $listen = 'https://127.0.0.1'
104+
. '?cert=t/mojo/certs/server.crt'
105+
. '&key=t/mojo/certs/server.key'
106+
. '&ca=t/mojo/certs/ca.crt'
107+
. '&version=TLSv1_2';
104108
my $port = $daemon->listen([$listen])->start->ports->[0];
105109

106110
subtest '(Not) setting verification mode' => sub {
@@ -116,9 +120,9 @@ subtest 'Client side TLS options' => sub {
116120

117121
subtest 'Setting acceptable protocol version' => sub {
118122
my $ua = Mojo::UserAgent->new(ioloop => Mojo::IOLoop->singleton);
119-
$ua->tls_options({SSL_version => 'TLSv1_2'});
123+
$ua->tls_options({SSL_version => 'TLSv1_3'});
120124
my $tx = $ua->get("https://localhost:$port");
121-
like $tx->error->{message}, qr/wrong ssl version/, 'has error';
125+
like $tx->error->{message}, qr/tlsv1 alert protocol version/, 'has error';
122126
};
123127
};
124128

0 commit comments

Comments
 (0)