Skip to content

Commit

Permalink
added test for verification bug
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed May 18, 2014
1 parent 9a9947f commit 701d26e
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions Changes
Expand Up @@ -17,6 +17,7 @@
- Improved Mojo::Parameters to consistently accept arrays.
- Fixed Mojo::IOLoop::Server to work correctly with newer versions of
IO::Socket::SSL. (noxxi)
- Fixed verification bug in Mojo::IOLoop::Server.
- Fixed path generation bug in Mojolicious::Routes::Match.
- Fixed warnings in Mojo::IOLoop::Delay.

Expand Down
2 changes: 2 additions & 0 deletions lib/Mojolicious.pm
Expand Up @@ -931,6 +931,8 @@ Rafal Pocztarski
Randal Schwartz
Rick Delaney
Robert Hicks
Robin Lee
Expand Down
24 changes: 24 additions & 0 deletions t/mojo/ioloop_tls.t
Expand Up @@ -340,4 +340,28 @@ is $client, 'connected', 'right result';
ok !$client_err, 'no error';
is $cipher, 'RC4-SHA', 'RC4-SHA has been negotiatied';

# Ignore missing client certificate
($server, $client, $client_err) = ();
$id = Mojo::IOLoop->server(
address => '127.0.0.1',
tls => 1,
tls_ca => 't/mojo/certs/ca.crt',
tls_cert => 't/mojo/certs/server.crt',
tls_key => 't/mojo/certs/server.key',
tls_verify => 0x01,
sub { $server = 'accepted' }
);
$port = Mojo::IOLoop->acceptor($id)->handle->sockport;
Mojo::IOLoop->client(
{port => $port, tls => 1} => sub {
shift->stop;
$client = 'connected';
$client_err = shift;
}
);
Mojo::IOLoop->start;
is $server, 'accepted', 'right result';
is $client, 'connected', 'right result';
ok !$client_err, 'no error';

done_testing();

0 comments on commit 701d26e

Please sign in to comment.