Skip Menu |

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

Report information
The Basics
Id: 123585
Status: new
Priority: 0/
Queue: HTTP-Server-Simple

Owner: Nobody in particular
Requestors: fsfs [...]

Bug Information
Severity: (no value)
Broken in: 0.44
Fixed in: (no value)

Subject: Cannot determine client ip-address when using ssl in net_server.
Download (untitled) / with headers
text/plain 1.3k
Forwarding Klaas Nijkes <> writes: --- I use an overriden version of the module Net::Server::Fork as net_server. This module uses the ssl-protocol in combination with IPv4. In the function handle_request it is now not possible to determine the ip-address and tcp-port of the client. This problem can be fixed with the following patch on /usr/share/perl5/HTTP/Server/ @@ -386,6 +387,12 @@ my $remote_sockaddr = getpeername( $self->stdio_handle ); my ( $iport, $iaddr ) = $remote_sockaddr ? sockaddr_in($remote_sockaddr) : (undef,undef); my $peeraddr = $iaddr ? ( inet_ntoa($iaddr) || "" ) : ''; + my $server = shift; + if ($server && $server->{'server'}) { + $self->{'server'} = $server->{'server'}; + $peeraddr = $self->{'server'}->{'peeraddr'} if ($self->{'server'}->{'peeraddr'}); + $iport = $self->{'server'}->{'peerport'} if ($self->{'server'}->{'peerport'}); + } my ( $method, $request_uri, $proto ) = $self->parse_request; The changes make it possible to use the peeraddr and peerport from Net::Server, which are passed to the process_request function since version 2.000. --- Although the code in question has been touched since 0.44, it looks like it would still suffer from the same issue.

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to