Skip to content

Commit

Permalink
improved compatibility with IO::Socket::SSL 1.87
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Apr 24, 2013
1 parent 71c3c41 commit 838ee10
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions Changes
@@ -1,6 +1,7 @@

3.97 2013-04-24
- Added data attribute to Mojo::URL.
- Improved compatibility with IO::Socket::SSL 1.87.
- Improved documentation.
- Improved tests.
- Fixed a few small timing bugs in WebSocket tests.
Expand Down
Empty file added t/mojo/certs/empty.crt
Empty file.
9 changes: 5 additions & 4 deletions t/mojo/user_agent_tls.t
Expand Up @@ -43,7 +43,7 @@ my $ua = Mojo::UserAgent->new(ioloop => Mojo::IOLoop->singleton);
my $tx = $ua->get("https://localhost:$port");
ok !$tx->success, 'not successful';
ok $tx->error, 'has error';
$tx = $ua->cert('')->key('')->get("https://localhost:$port");
$tx = $ua->get("https://localhost:$port");
ok !$tx->success, 'not successful';
ok $tx->error, 'has error';

Expand Down Expand Up @@ -96,9 +96,9 @@ $ua = Mojo::UserAgent->new(ioloop => $ua->ioloop);
is $tx->res->body, 'works!', 'right content';
}

# Invalid certificate authority
# Empty certificate authority
$ua = Mojo::UserAgent->new(ioloop => $ua->ioloop);
$ua->ca('no file')->cert('t/mojo/certs/client.crt')
$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';
Expand All @@ -113,7 +113,8 @@ ok $tx->error, 'has error';

# Empty certificate
$ua = Mojo::UserAgent->new(ioloop => $ua->ioloop);
$tx = $ua->cert('no file')->key('no file')->get("https://localhost:$port");
$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';

Expand Down

0 comments on commit 838ee10

Please sign in to comment.