Skip Menu |

This queue is for tickets about the Net-Async-HTTP CPAN distribution.

Report information
The Basics
Id: 94303
Status: resolved
Priority: 0/
Queue: Net-Async-HTTP

People
Owner: Nobody in particular
Requestors: leonerd-cpan [...] leonerd.org.uk
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.34
Fixed in: 0.35



Subject: Failures during redirects go missing
It seems we can't talk HTTPS to yahoo (possibly a separate bug): $ perl -Mblib examples/GET.pl https://www.yahoo.com Failed - uk.yahoo.com:80 - SSL connect attempt failed with unknown error error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol failed [ssl] uk.yahoo.com:80 - SSL connect attempt failed with unknown error error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol failed [ssl] at examples/GET.pl line 39. However, if this failure occurs during a redirect, that failure gets ignored: $ perl -Mblib examples/GET.pl http://www.yahoo.com ^C ((hangs forever until timeout/SIGINT)) $ IO_ASYNC_DEBUG=1 perl -Mblib examples/GET.pl http://www.yahoo.com [Na:HTTP::Connection{www.yahoo.com:80,connecting}<-Na:HTTP] CONNECT www.yahoo.com:80 [Ia:Resolver] CALL [Ia:Stream{r=5}<-Ia:Channel<-Ia:Function::Worker<-Ia:Resolver] EVENT on_read [Na:HTTP::Connection{www.yahoo.com:80,connecting}<-Na:HTTP] CONNECTED [Na:HTTP::Connection{www.yahoo.com:80,connecting}<-Na:HTTP] READY non-pipelined [Na:HTTP::Connection{www.yahoo.com:80,connecting}<-Na:HTTP] REQUEST GET http://www.yahoo.com [Na:HTTP::Connection{www.yahoo.com:80,fd=3}<-Na:HTTP] HEADER 301 Redirect [Na:HTTP::Connection{www.yahoo.com:80,fd=3}<-Na:HTTP] BODY length 213 [Na:HTTP::Connection{www.yahoo.com:80,fd=3}<-Na:HTTP] BODY done [Na:HTTP::Connection{www.yahoo.com:80,fd=3}<-Na:HTTP] CLOSED [Na:HTTP::Connection{www.yahoo.com:443,connecting}<-Na:HTTP] CONNECT www.yahoo.com:443 [Ia:Resolver] CALL [Na:HTTP::Connection{www.yahoo.com:80,fd=3}] DONE remaining in-flight=0 [Ia:Stream{r=5}<-Ia:Channel<-Ia:Function::Worker<-Ia:Resolver] EVENT on_read [Na:HTTP::Connection{www.yahoo.com:443,connecting}<-Na:HTTP] CONNECTED [Na:HTTP::Connection{www.yahoo.com:443,connecting}<-Na:HTTP] READY non-pipelined [Na:HTTP::Connection{www.yahoo.com:443,connecting}<-Na:HTTP] REQUEST GET https://www.yahoo.com/ ^C -- Paul Evans
On Sat Mar 29 13:40:13 2014, PEVANS wrote: Show quoted text
> It seems we can't talk HTTPS to yahoo (possibly a separate bug):
Turns out this bug was that if an HTTPS request redirects to an HTTP URI, we forgot to turn off SSL, so tried to negotiate SSL over port 80. Attached patch fixes this, and in fact the original problem. -- Paul Evans
Subject: rt94303.patch
=== modified file 'lib/Net/Async/HTTP.pm' --- lib/Net/Async/HTTP.pm 2014-03-29 18:10:53 +0000 +++ lib/Net/Async/HTTP.pm 2014-03-29 18:38:27 +0000 @@ -664,9 +664,14 @@ return Future->new->fail( "Unable to parse '$location' as a URI", http => $previous_response, $request ); } + $self->debug_printf( "REDIRECT $loc_uri" ); + $args{on_redirect}->( $previous_response, $location ) if $args{on_redirect}; %args = $self->_make_request_for_uri( $loc_uri, %args ); + $request = $args{request}; + + undef $host; undef $port; undef $ssl; } my $uri = $request->uri;
This was released some time ago in 0.35 -- Paul Evans