Re: Issue with latest version and SSL site

[email protected] ("Markus Moeller") Wed, 26 Sep 2012 20:27:22 +0100
Newsgroups perl.libwww
Message-ID <[email protected]>
Some more details if it helps:

I tried with new perl-5.10.1 and perl-5.16.1 and cpan -i LWP::UserAgent 
LWP::Protocol::https . This will install all dependencies including 
Net:SSLeay for which I tried openssl 0.9.8x and 1.0.1c.  All fail ( 
with1.0.1c I get a connect error wheras with 0.9.8x I get  a partial 
download).

Thank you
Markus

"Markus Moeller" <[email protected]> wrote in message 
news:[email protected]...
> Hi,
>
> I have a problem that my perl modules are not anymore downloading a large 
> file from a https site.  It worked with a previoius built, but since I 
> update all modules via cpan it fails after downloading  some parts.
>
> I use the following code:
>
> sub http_transfer {
>
>    my ( $url, $file  ) = @_;
>
>    die "Need url and dest_file as params" unless @_ > 1;
>
>    # set the method:
>    $method ||= "get";
>
>    log_and_die("I need a URL!") unless ($url);
>
>    # skip certification verification:
>    my $ua = LWP::UserAgent->new( ssl_opts => { verify_hostname => 0 });
>    my $response;
>
>    if ( $method eq "get" ) {
>
>        my $file_dir ||= dirname($file);
>        unless ( -d $file_dir ) {
>            make_path $file_dir ;
>        }
>
>        # set content_file for output, and send the request:
>        $response = $ua->get($url, ':content_file' => $file );
>
>    }
>    if ( $response->is_error ) {
>        log_and_die( "[" . $response->status_line . "] error trying to 
> $method $url.");
>    }
> } # end sub _http_transfer
>
>
> The platform I run on is Solaris 10 and perl ,  openssl is compiled with 
> SUNWspro cc.
>
> Any idea how to debug ?  When I use truss I see my old perl modules just 
> read until the end whereas the new modules for some reason get a read = 0 
> somewhere at the beginning of the file download.
>
> Thank you
> Markus
>
>