Skip to content

Commit

Permalink
improved compatibility with IO::Socket::SSL 1.957
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Nov 11, 2013
1 parent 1ac6e17 commit 9f81d4f
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 21 deletions.
3 changes: 3 additions & 0 deletions Changes
@@ -1,4 +1,7 @@

4.57 2013-11-11
- Improved compatibility with IO::Socket::SSL 1.957.

4.56 2013-11-09
- Fixed backspace escaping bug in Mojo::JSON. (ig3)

Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious.pm
Expand Up @@ -43,7 +43,7 @@ has types => sub { Mojolicious::Types->new };
has validator => sub { Mojolicious::Validator->new };

our $CODENAME = 'Top Hat';
our $VERSION = '4.56';
our $VERSION = '4.57';

sub AUTOLOAD {
my $self = shift;
Expand Down
Empty file removed t/mojo/certs/empty.crt
Empty file.
4 changes: 2 additions & 2 deletions t/mojo/ioloop_tls.t
Expand Up @@ -319,7 +319,7 @@ $loop->server(
tls => 1,
tls_ca => 't/mojo/certs/ca.crt',
tls_cert => 't/mojo/certs/server.crt',
tls_ciphers => 'RC4-MD5:ALL',
tls_ciphers => 'RC4-SHA:ALL',
tls_key => 't/mojo/certs/server.key',
tls_verify => 0x00,
sub {
Expand All @@ -345,6 +345,6 @@ $loop->start;
is $server, 'accepted', 'right result';
is $client, 'connected', 'right result';
ok !$client_err, 'no error';
is $cipher, 'RC4-MD5', 'RC4-MD5 has been negotiatied';
is $cipher, 'RC4-SHA', 'RC4-SHA has been negotiatied';

done_testing();
21 changes: 3 additions & 18 deletions t/mojo/user_agent_tls.t
Expand Up @@ -95,28 +95,13 @@ $ua = Mojo::UserAgent->new(ioloop => $ua->ioloop);
is $tx->res->body, 'works!', 'right content';
}

# Empty certificate authority
$ua = Mojo::UserAgent->new(ioloop => $ua->ioloop);
$ua->ca('t/mojo/certs/empty.crt')->cert('t/mojo/certs/client.crt')
->key('t/mojo/certs/client.key');
$tx = $ua->get("https://localhost:$port");
ok !$tx->success, 'not successful';
ok $tx->error, 'has error';

# Invalid certificate
$ua = Mojo::UserAgent->new(ioloop => $ua->ioloop);
$ua->cert('t/mojo/certs/badclient.crt')->key('t/mojo/certs/badclient.key');
$tx = $ua->get("https://localhost:$port");
ok !$tx->success, 'not successful';
ok $tx->error, 'has error';

# Empty certificate
$ua = Mojo::UserAgent->new(ioloop => $ua->ioloop);
$tx = $ua->cert('t/mojo/certs/empty.crt')->key('t/mojo/certs/empty.crt')
->get("https://localhost:$port");
ok !$tx->success, 'not successful';
ok $tx->error, 'has error';

# Web server with valid certificates and no verification
$daemon = Mojo::Server::Daemon->new(
app => app,
Expand All @@ -128,7 +113,7 @@ $listen
. '?cert=t/mojo/certs/server.crt'
. '&key=t/mojo/certs/server.key'
. '&ca=t/mojo/certs/ca.crt'
. '&ciphers=RC4-MD5:ALL'
. '&ciphers=RC4-SHA:ALL'
. '&verify=0x00';
$daemon->listen([$listen])->start;

Expand All @@ -138,7 +123,7 @@ $ua->cert('t/mojo/certs/badclient.crt')->key('t/mojo/certs/badclient.key');
$tx = $ua->get("https://localhost:$port");
ok $tx->success, 'successful';
ok !$tx->error, 'no error';
is $ua->ioloop->stream($tx->connection)->handle->get_cipher, 'RC4-MD5',
'RC4-MD5 has been negotiatied';
is $ua->ioloop->stream($tx->connection)->handle->get_cipher, 'RC4-SHA',
'RC4-SHA has been negotiatied';

done_testing();

0 comments on commit 9f81d4f

Please sign in to comment.