I have set up a Mojolicious::Lite server with SSL support using Hypnotoad. I am using Mojolicious::Plugin::SslAuth for authenticating the client certificate. When I call dump_peer_certificate()
I get
[Tue Feb 12 07:26:32 2019] [debug] peer: Subject Name: undefined Issuer Name: undefined
but I expected valid certificate information. Can you help me to understand this message?
Here is SSL handler code:
sub register {
my ($plugin, $app) = @_;
$app->helper(
ssl_auth => sub {
my $self = shift;
my $callback = shift;
my $id = $self->tx->connection;
my $handle = Mojo::IOLoop->stream($id)->handle;
# dump_peer_certificate returns-
# Subject Name: undefined
# Issuer Name: undefined
$app->log->debug("peer: " . $handle->dump_peer_certificate());
# Not SSL connection
return if ref $handle ne 'IO::Socket::SSL';
return $callback->($handle);
}
);
}