Subject: | Documented SSL procedure fails due to HTTP::Daemon::SSL when not using a hostname (IPv6?). |
Using the documented procedure for SSL, it fails due to:
Socket::inet_ntoa, length is 16, should be 4 at
/usr/local/share/perl5/HTTP/Daemon.pm line 48.
You need to specify a host (such as localhost) for this to work. (I
think it defaults to IPv6, at least on RHEL 6.1).
This is probably an issue with HTTP::Daemon::SSL, but I've added to have
this documented.
RHEL 6.1 x86_64, perl 5.10.1 (build in).
#!/usr/bin/perl
use HTTP::Server::Brick;
use HTTP::Status;
use HTTP::Daemon::SSL;
# openssl req -x509 -nodes -days 365 -subj \
# '/C=US/ST=Nowhere/L=Nowhere/CN=www.bla.com' -newkey rsa:1024 \
# -keyout my_ssl_key.pem -out my_ssl_cert.pem
my $server = HTTP::Server::Brick->new(
port => 8889,
daemon_class => 'HTTP::Daemon::SSL',
daemon_args => [
SSL_key_file => 'my_ssl_key.pem',
SSL_cert_file => 'my_ssl_cert.pem',
],
);
$server->mount( '/git' => { path => '/home/cmihai/git', } );
# receives a HUP signal)
$server->start;
# [Tue Dec 6 18:51:52 2011] [10275] Mounted wildcard directory at /git
# [Tue Dec 6 18:51:52 2011] [10275] [die] Bad arg length for
Socket::inet_ntoa, length is 16, should be 4 at
/usr/local/share/perl5/HTTP/Daemon.pm line 48.
# Bad arg length for Socket::inet_ntoa, length is 16, should be 4 at
/usr/local/share/perl5/HTTP/Daemon.pm line 48.