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


In reply to HTTPS with lwp problem. by RedGrinGo

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.