vishnu787 has asked for the wisdom of the Perl Monks concerning the following question:

use strict; use WWW::Mechanize; use WWW::Mechanize::FormFiller; my $mechanize = WWW::Mechanize->new( autocheck => 1 ); my $formfiller = WWW::Mechanize::FormFiller->new(); $mechanize->proxy(['http', 'ftp', 'https'], 'http://tant-a01\\santu:Xi +us12345678@naproxy.XXX.com:80'); $mechanize->get('http://www.redhat.com'); #$mechanize->get('https://www.redhat.com'); print $mechanize->status(); my $page = $mechanize->content; print $page; cpan> install IO::Socket::SSL Going to read '/root/.cpan/Metadata' Database was generated on Sat, 06 Mar 2010 22:36:41 GMT IO::Socket::SSL is up to date (1.32). + + cpan> install Crypt::SSLeay Crypt::SSLeay is up to date (0.57).

Above code works fine with the http link but when using with https it comes back with the below message.

"Error GETing https://www.redhat.com: Bad Request at test.pl line 9"

Any help/suggestions would be highly appreciated

Thanks Vishnu

Replies are listed 'Best First'.
Re: Mechanize https proxy not working
by Khen1950fx (Canon) on Mar 09, 2010 at 11:54 UTC
    I tried it, and it came back 200; however, it mentioned that it was an unknown domain and that www.redhat.com wasn't on that server.

      The same code works with any http link, but doesn't work with an https link

      Tried with another https link and the same result

      Error GETing https://www.guardiananytime.com/: Bad Request at test.pl line 9
        1) turn on debugging 2) do you know if your proxy supports https?
        I don't know what is causing your problem. I'd use a different module to get the https link. Something like IO::All::HTTPS
        #!/usr/bin/perl use strict; use warnings; use IO::All; my $content < io('https://www.guardiananytime.com'); print $content, "\n";