summaryrefslogtreecommitdiff
path: root/lib/PAUSE/OpenID/Controller/Root.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/PAUSE/OpenID/Controller/Root.pm')
-rw-r--r--lib/PAUSE/OpenID/Controller/Root.pm14
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/PAUSE/OpenID/Controller/Root.pm b/lib/PAUSE/OpenID/Controller/Root.pm
index 67d4411..6ffa03b 100644
--- a/lib/PAUSE/OpenID/Controller/Root.pm
+++ b/lib/PAUSE/OpenID/Controller/Root.pm
@@ -76,22 +76,32 @@ sub login :Local {
$c->log->debug('username "'.$username.'" login attempt');
my $ua = LWP::UserAgent->new;
+ my $req = HTTP::Request->new(GET => 'https://pause.perl.org/pause/authenquery');
+ $req->header('If-SSL-Cert-Subject' => '/CN=pause.perl.org');
+ local $ENV{HTTPS_CA_DIR} = $c->config->{'ssl'}->{'ca_dir'};
$ua->credentials('pause.perl.org:443', 'PAUSE', $username, $password);
- my $res = $ua->get('https://pause.perl.org/pause/authenquery');
+ my $res = $ua->request($req);
+
+ die 'pause server certificate validation failed'
+ if exists $res->headers->{'client-ssl-warning'};
if ($res->code == 200) {
$c->log->info('login pass');
+ $c->session->{pauseid} = $username;
$c->res->redirect($c->uri_for('/login_pass'));
}
else {
$c->log->warn('login failed');
+ use Data::Dumper;
+ die Dumper($res);
+
$c->res->redirect($c->uri_for('/login_failed'));
}
}
sub login_pass :Local {
my ( $self, $c ) = @_;
-
+
$c->res->content_type('text/plain');
$c->res->body('login pass');
}