Hi Gustavo, I tried both, still getting same error.
tx. Rajeev ________________________________ From: Gustavo Telly <gustavo.te...@gmail.com> To: Rajeev Prasad <rp.ne...@yahoo.com> Cc: perl list <beginners@perl.org> Sent: Thursday, October 20, 2011 11:45 AM Subject: Re: LWP::UserAgent 501 Not Implemented only for https?? [firefox works fine] Hello Rajeev, Did you try: $ua->protocols_allowed( [ 'http', 'https'] ); or $ua->protocols_allowed(undef); ?? 2011/10/20 Rajeev Prasad <rp.ne...@yahoo.com> anyone ? plz > > > > >here is my script which is trying to access two websites, from my linux box. i >am not able to figure, why am i getting "501 Not Implemented" for any https >website. > >especially when the firefox browser from the same box can access the websites >fine using same proxy. proxy does not require username/password authentication. > > >I do have Crypt::SSLeay installed. > > > >#!/usr/bin/perl >use strict; >use warnings; >use LWP::UserAgent; > >my $ua = LWP::UserAgent->new; >$ua->proxy(['https', 'http', 'ftp'], 'http://myproxy.net:8080/'); >$ua->agent('Mozilla/5.0'); > > >my $response = $ua->get( 'http://www.yahoo.com' , ':content_file' => >"testhttp.html" ); > if ($response->is_success) { > print "success\n"; > } > else { > print "error\n"; > # die $response->status_line; > } > >$response = $ua->get('https://mail.yahoo.com', ':content_file' => >'testhttps.html'); > if ($response->is_success) { > print "success\n"; #$response->decoded_content; # or whatever > } > else { > print "error\n"; > die $response->status_line; > }