in reply to Re^2: Mechanize https proxy not working
in thread Mechanize https proxy not working

1) turn on debugging 2) do you know if your proxy supports https?
  • Comment on Re^3: Mechanize https proxy not working

Replies are listed 'Best First'.
Re^4: Mechanize https proxy not working
by vishnu787 (Initiate) on Mar 10, 2010 at 06:13 UTC

    1)with the same proxy settings wget and elinks are working good

    2)can you please let me know how to turn debugging on...Thanks
      $ua->add_handler("request_send", sub { shift->dump; return }); $ua->add_handler("response_done", sub { shift->dump; return });
        use strict; use WWW::Mechanize; use WWW::Mechanize::FormFiller; my $mechanize = WWW::Mechanize->new( autocheck => 1 ); my $formfiller = WWW::Mechanize::FormFiller->new(); $mechanize->add_handler("request_send", sub { shift->dump; return }); $mechanize->proxy(['http', 'ftp', 'https'], 'http://tant-a01\\santu:Xi +us12345678@naproxy.XXX.com:80'); $mechanize->get('http://www.redhat.com'); $mechanize->add_handler("response_done", sub { shift->dump; return }); #$mechanize->get('https://www.redhat.com'); print $mechanize->status(); my $page = $mechanize->content; print $page; OUTOPUT GET https://www.redhat.com Accept-Encoding: gzip User-Agent: WWW-Mechanize/1.60 (no content) Error GETing https://www.redhat.com: Bad Request at test.pl line 10 Another try use strict; use WWW::Mechanize; use WWW::Mechanize::FormFiller; my $mechanize = WWW::Mechanize->new( autocheck => 1 ); my $formfiller = WWW::Mechanize::FormFiller->new(); $mechanize->add_handler("request_send", sub { shift->dump; return }); $mechanize->add_handler("response_done", sub { shift->dump; return }); $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; OUTPUT GET https://www.redhat.com Accept-Encoding: gzip User-Agent: WWW-Mechanize/1.60 (no content) HTTP/1.1 400 Bad Request Cache-Control: no-cache Connection: close Pragma: no-cache Content-Length: 691 Content-Type: text/html; charset=utf-8 Client-Date: Wed, 10 Mar 2010 08:47:21 GMT Client-Peer: 141.202.248.209:80 Client-Response-Num: 1 Title: Request Error <HTML><HEAD> <TITLE>Request Error</TITLE> </HEAD> <BODY> <FONT face="Helvetica"> <big><strong></strong></big><BR> </FONT> <blockquote> <TABLE border=0 cellPadding=1 width="80%"> <TR><TD> <FONT face="Helvetica"> <big>Request Error (invalid_request)</big> <BR> <BR> </FONT> </TD></TR> <TR><TD> <FONT face="Helvetica"> Your request could not be processed. Request could not be handled </FONT> </TD></TR> <TR><TD> <FONT face="Helvetica"> This could be caused by a misconfiguration, or possibly a malformed re +quest. <... (+ 179 more bytes not shown) Error GETing https://www.redhat.com: Bad Request at test.pl line 11
        </code>