in reply to Re^2: HTTPS connection problems WWW::Mechanize , LWP
in thread HTTPS connection problems WWW::Mechanize , LWP

but I have already put it there.

Except , like Corion stated, its not in a BEGIN block, BEGIN block is key

  • Comment on Re^3: HTTPS connection problems WWW::Mechanize , LWP

Replies are listed 'Best First'.
Re^4: HTTPS connection problems WWW::Mechanize , LWP
by vishy_acts (Novice) on Apr 01, 2011 at 11:59 UTC

    Here is the updated code and same error.

    #!/usr/bin/perl use strict; BEGIN { $ENV{HTTPS_PROXY} = 'my_proxy:port'; }; use WWW::Mechanize; use Crypt::SSLeay; my $mech = WWW::Mechanize->new(autocheck => 1,noproxy => 1); $mech->cookie_jar(HTTP::Cookies->new); $mech->agent('Mozilla/5.0'); $mech->proxy(['https', 'http', 'ftp'], 'my_proxy:port'); # http $mech->get("http://www.google.com"); my $test = $mech->forms(); # https $mech->get("https://www.irctc.co.in") ; die $mech->response->status_line unless $mech->success; my $test = $mech->forms();
    <error> DB<1> r Error GETing https://www.irctc.co.in: Bad Request at pnr_2.perl line 28 at C:/strawberry/perl/lib/WWW/Mechanize.pm line 2747 WWW::Mechanize::_die('Error ', 'GET', 'ing ', 'URI::https=SCALAR(0x19ba23c)', ': ', 'Bad Request') called at C:/strawberry /perl/lib/WWW/Mechanize.pm line 2734 WWW::Mechanize::die('WWW::Mechanize=HASH(0x15ddcf4)', 'Error ', 'GET', 'ing ', 'URI::https=SCALAR(0x19ba23c)', ': ', 'Bad Request') called at C:/strawberry/perl/lib/WWW/Mechanize.pm line 2383 WWW::Mechanize::_update_page('WWW::Mechanize=HASH(0x15ddcf4)', 'HTTP::Request=HASH(0x19ba5dc)', 'HTTP::Response=HASH(0x19b a39c)') called at C:/strawberry/perl/lib/WWW/Mechanize.pm line 2213 WWW::Mechanize::request('WWW::Mechanize=HASH(0x15ddcf4)', 'HTTP::Request=HASH(0x19ba5dc)') called at C:/strawberry/perl/ve ndor/lib/LWP/UserAgent.pm line 389 LWP::UserAgent::get('WWW::Mechanize=HASH(0x15ddcf4)', 'https://www.irctc.co.in') called at C:/strawberry/perl/lib/WWW/Mech anize.pm line 407 WWW::Mechanize::get('WWW::Mechanize=HASH(0x15ddcf4)', 'https://www.irctc.co.in') called at pnr_2.perl line 28 Debugged program terminated. Use q to quit or R to restart, use o inhibit_exit to avoid stopping after program termination, h q, h R or h o to get additional info. DB<1> </error> </error>