Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
small test tweaks
  • Loading branch information
kraih committed Jul 10, 2012
1 parent 78d140c commit 7572d14
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/Mojo/Server/Daemon.pm
Expand Up @@ -153,7 +153,7 @@ sub _listen {
port => $url->port,
tls_ca => scalar $query->param('ca'),
tls_cert => scalar $query->param('cert'),
tls_key => scalar $query->param('key'),
tls_key => scalar $query->param('key')
};
my $verify = $query->param('verify');
$options->{tls_verify} = hex $verify if defined $verify;
Expand Down
8 changes: 3 additions & 5 deletions t/mojo/user_agent_tls.t
Expand Up @@ -118,11 +118,9 @@ $tx = $ua->cert('no file')->key('no file')->get("https://localhost:$port");
ok !$tx->success, 'not successful';
ok $tx->error, 'has error';

# Disable peer certificate checks
undef $daemon;
# Web server with valid certificates and no verification
$daemon
= Mojo::Server::Daemon->new(app => app, ioloop => Mojo::IOLoop->singleton);
$port = Mojo::IOLoop->new->generate_port;
$listen
= "https://127.0.0.1:$port"
. '?cert=t/mojo/certs/server.crt'
Expand All @@ -135,5 +133,5 @@ $daemon->listen([$listen])->start;
$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, 'is successful';
ok !$tx->error, 'has no error';
ok $tx->success, 'successful';
ok !$tx->error, 'no error';

0 comments on commit 7572d14

Please sign in to comment.