Skip Menu |

This queue is for tickets about the Net_SSLeay.pm CPAN distribution.

Report information
The Basics
Id: 9611
Status: resolved
Priority: 0/
Queue: Net_SSLeay.pm

People
Owner: Nobody in particular
Requestors: ivan-cpan-rt [...] 420.am
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.25
Fixed in: (no value)



Subject: [patch] Net::SSLeay adds an additional Host: header even if one is specified
Net::SSLeay's do_httpx3 adds an additional Host: header, even if you specify one explicitly. The following patch fixes this and also omits the ":$port" suffix for standard ports (please let me know if you would like a patch without this part). I spent quite some time debugging why Business::OnlinePayment::SecureHostingUPG worked with Crypt::SSLeay but not with Net::SSLeay. diff -u libnet-ssleay-perl-1.25.orig/SSLeay.pm libnet-ssleay-perl-1.25/SSLeay.pm --- libnet-ssleay-perl-1.25.orig/SSLeay.pm 2005-01-10 21:59:37.000000000 -0800 +++ libnet-ssleay-perl-1.25/SSLeay.pm 2005-01-10 22:00:31.000000000 -0800 @@ -2216,8 +2216,16 @@ } else { $content = "$CRLF$CRLF"; } - my $req = "$method $path HTTP/1.0$CRLF"."Host: $site:$port$CRLF" - . (defined $headers ? $headers : '') . "Accept: */*$CRLF$content"; + + my $req = "$method $path HTTP/1.0$CRLF"; + unless ( defined $headers && $headers =~ /^Host:/m ) { + $req .= "Host: $site"; + unless ( ( $port==80 && !$usessl ) || ( $port==443 && $usessl ) ) { + $req .= ":$port"; + } + $req .= $CRLF; + } + $req .= (defined $headers ? $headers : '') . "Accept: */*$CRLF$content"; warn "do_httpx3($method,$usessl,$site:$port)" if $trace; my ($http, $errs, $server_cert)