@@ -82,7 +82,7 @@ subtest 'Web server with valid certificates and no verification' => sub {
82
82
. ' &ca=t/mojo/certs/ca.crt'
83
83
. ' &ciphers=AES256-SHA:ALL'
84
84
. ' &verify=0x00'
85
- . ' &version=TLSv1 ' ;
85
+ . ' &version=TLSv1_2 ' ;
86
86
my $port = $daemon -> listen ([$listen ])-> start-> ports-> [0];
87
87
88
88
# Invalid certificate
@@ -95,12 +95,16 @@ subtest 'Web server with valid certificates and no verification' => sub {
95
95
$tx = $ua -> get(" https://localhost:$port " );
96
96
ok !$tx -> error, ' no error' ;
97
97
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' ;
99
99
};
100
100
101
101
subtest ' Client side TLS options' => sub {
102
102
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' ;
104
108
my $port = $daemon -> listen ([$listen ])-> start-> ports-> [0];
105
109
106
110
subtest ' (Not) setting verification mode' => sub {
@@ -116,9 +120,9 @@ subtest 'Client side TLS options' => sub {
116
120
117
121
subtest ' Setting acceptable protocol version' => sub {
118
122
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 ' });
120
124
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' ;
122
126
};
123
127
};
124
128
0 commit comments