RedGrinGo has asked for the wisdom of the Perl Monks concerning the following question:
Hello all,
I am try to get html code from a site with a prefix of "https://ssl..." my goal is to fetch data to txt file but this site got authentication. I need to authen this site and then send a request with search terms to get the data I need. I got several error that need attention. 1. Peer certificate not verified 2. HTTP Error 411. The request must be chunked or have a content length.
use strict; use warnings; use LWP::UserAgent; use Crypt::SSLeay; my $base = 'https://ssl...'; my $cgi = 'terms with authen values' my $wrapper = new wrapper; my %hash = ( cgi_method => 'GET', url => $base, redirection=> 'yes', proxy_type => $proxy_type, proxy_address => $proxy_address, proxy_credentials => $proxy_credentials, ); $wrapper->call_httpd_exec(\%hash); my $response = $hash{response}; %hash = ( cgi_method => 'POST', #cgi_param => $cgi, url => $base, port => '443', redirection => 'yes', proxy_type => $proxy_type, proxy_address => $proxy_address, proxy_credentials => $proxy_credentials, ); $wrapper->call_httpd_exec(\%hash); print %hash; $response = $hash{response}; print "\n##/n$response##\n"; my $redirect = $hash{request}->request->uri; print "\n##/n$redirect##\n"; %hash = ( cgi_method => 'GET', #cgi_param => $cgi, url => $redirect, port => '443', redirection => 'yes', proxy_type => $proxy_type, proxy_address => $proxy_address, proxy_credentials => $proxy_credentials, ); $wrapper->call_httpd_exec(\%hash); $response = $hash{response}; print "\n##/n$response##\n";
any help will be more than welcom. Thanks a lot Monks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: HTTPS with lwp problem.
by ikegami (Patriarch) on Nov 03, 2009 at 06:36 UTC | |
by RedGrinGo (Novice) on Nov 03, 2009 at 07:02 UTC | |
by ikegami (Patriarch) on Nov 03, 2009 at 08:12 UTC |