Skip Menu |

This queue is for tickets about the HTTP-Server-Brick CPAN distribution.

Report information
The Basics
Id: 73058
Status: open
Priority: 0/
Queue: HTTP-Server-Brick

People
Owner: Nobody in particular
Requestors: cmihai [...] boreas.ro
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.1.4
Fixed in: (no value)



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.
From: cmihai [...] boreas.ro
On Tue Dec 06 17:49:30 2011, cmihai wrote: Show quoted text
> 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 Show quoted text
> 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 Show quoted text
> # [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.
Correction: you need to specify a FQDN, localhost does not seem to work. Seen something similar in: http://www.cpantesters.org/cpan/report/06405689-b19f-3f77-b713- d32bba55d77f
Could well be IPv6 - I'm not sure I ever tried it. I won't be able to take a look until Jan. If you have any patches they would be welcome :)