RE: Timeout issue with HTTPS connection

Robert (robert@chalmers.com.au)
Tue, 20 Mar 2001 07:36:40 +1000


I had a similar problem to this recently. I tracked it to the crypt routines
I was using.

 I was using DES. I switched to Blowfish and the problem went away. I never
did find out where the conflict was...


Bob

> -----Original Message-----
> From: tallwine@oreilly.com [mailto:tallwine@oreilly.com]
> Sent: Tuesday, 20 March 2001 2:23 AM
> To: Eric Gauthier
> Cc: libwww@perl.org
> Subject: Re: Timeout issue with HTTPS connection
>
>
> On Fri, Mar 16, 2001 at 05:17:43PM -0500, Eric Gauthier wrote:
> > Hello.
> >
> > I'm trying to track down an issue I'm currently having using Spong
> > 2.7.0 with the "check_https" module installed.  The error message
> > that I'm receiving, when making an HTTPS call is:
> >
> > Fri Mar 16 17:15:36 2001 Error: No check function defined for https:
> > Can't call method "request" on an undefined value at
> > /usr/local/lib/perl5/site_perl/5.6.1/LWP/UserAgent.pm line 227.
> >
> > This appears to occur when the timeout expires before a response is
> > generated.  Is the check_https routine not setting some parameter
> > correctly?
>
> When trying to fetch https documents and they timeout this is
> what I've found. Line 211 of UserAgent.pm has the following
> wrapped in an eval
>
>     eval {
> 	$response = $protocol->request($request, $proxy,
> 	    $arg, $size, $timeout);
>     };
>
> If I timeout when I request an https document $@ is not set and the
> if statement after the above eval fails! Goto line 215 it says:
>
>     if ($@) {
> 	$@ =~ s/\s+at\s+\S+\s+line\s+\d+.*//;
> 	$response =
> 	    HTTP::Response->new(&HTTP::Status::RC_INTERNAL_SERVER_ERROR,
> 		$@);
>     }
>
> But $@ is not set!
>
> Try putting a print statement in after the $protocol->request
> line in the eval and setting a short timeout in your code. The
> timeout will happen and you will never see the print because the
> request never returns, it dies.  The question is why isn't $@
> being set. On line 31 of SSL.pm part of the Crypt::SSLeay
> distribution in the sub DESTROY he has the $self->SUPER::DESTROY
> wrapped in an eval. If I add a 'local $@' after the $self = shift
> line it fixes it or if I remove the eval and just have the
> $self->SUPER::DESTROY by itself if fixes it.
>
> Any thoughts?
>
> -Tim
>