Subject: | Bug in Net::SSL when reading reply to CONNECT from proxy server |
I think I've found a bug in Net::SSL. On line 381 in Net/SSL.pm version
2.85 the regular expression that is used to match the reply from the
server is missing a treat-string-as-single-line modifier. This means
that it will never match if the server replies with multiple lines.
Adding an "s" modifier to the regular expression should fix the problem:
--- ../Crypt-SSLeay-0.64/lib/Net/SSL.pm 2012-07-30 23:56:24.000000000
+0200
+++ Net/SSL.pm 2012-08-24 20:34:32.915845000 +0200
@@ -378,7 +378,7 @@
# better) may actually make this problem go away, but either way,
# there is no good reason to use \d when checking for 0-9
- while ($header !~ m{HTTP/[0-9][.][0-9]\s+200\s+.*$CRLF$CRLF}) {
+ while ($header !~ m{HTTP/[0-9][.][0-9]\s+200\s+.*$CRLF$CRLF}s) {
$timeout = $self->timeout(5) unless length $header;
my $n = $self->SUPER::sysread($header, 8192, length $header);
last if $n <= 0;
/jubk