Click here to get back home

Proxy method does not work using LWP::UserAgent for HTTPS request

 HomeNewsGroups | Search

comp.lang.perl.modules - Discussion about PERL modules 

get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Proxy method does not work using LWP::UserAgent for HTTPS request shallyee 09-09-2008
Posted by shallyee on September 9, 2008, 6:53 am
Please log in for more thread options


I have following sample getting file via HTTPS protocal using
LWP::UserAgent module.

#!/usr/bin/perl

use LWP::UserAgent;
use LWP::Debug qw(+);

$uri = $ARGV[0];
show/hide quoted text
#$ENV = 'myproxy.mydomain:8080'; # (A) this works
show/hide quoted text
don't works at all

show/hide quoted text
}
else {
show/hide quoted text
}

Setting HTTPS_PROXY environment variable works fine, but
show/hide quoted text

koroke:~/tmp$ https_get.pl https://www.somedomain.jp/
LWP::UserAgent::new: ()
LWP::UserAgent::proxy: https myproxy.mydomain:8080
LWP::UserAgent::request: ()
LWP::UserAgent::send_request: GET https://www.somedomain.jp/
LWP::UserAgent::_need_proxy: Proxied to myproxy.mydomain:8080
LWP::UserAgent::request: Simple response: Not Implemented
501 Protocol scheme '' is not supported at https_get.pl line 17.

Who can explain that's different?
Thanks.

Posted by C.DeRykus on September 12, 2008, 6:33 pm
Please log in for more thread options


On Sep 9, 3:53 am, shall...@gmail.com wrote:
show/hide quoted text

I'm not positive this is correct
but it appears the scheme in
the actual proxy specification is implicit with ENV but not with
the 'ua' method call. So,

show/hide quoted text

according to the UserAgent doc examples, should instead read, eg.,

show/hide quoted text
'https://.....' );


--
Charles DeRykus

Posted by shallyee on October 1, 2008, 3:11 am
Please log in for more thread options


On 9$B7n(B13$BF|(B, $B8aA0(B7:33, "C.DeRykus"
show/hide quoted text

Thanks for your great hint. Your advise works for HTTP,

show/hide quoted text
...This is good for HTTP URLs, but for HTTPS URLs, both of following
failed.

show/hide quoted text
...this gives "500 SSL negotiation failed" after a long hang up.

show/hide quoted text
...this gives "400 Bad Request".

Any ideas?

Similar ThreadsPosted
LWP, https and a proxy February 22, 2005, 7:43 am
Using HTTPS with LWP::UserAgent = Bad Service March 30, 2005, 6:45 am
LWP::UserAgent + HTTPS + threads ==> segmentation fault November 11, 2004, 9:57 pm
How do you send a custom request with LWP::UserAgent? July 31, 2005, 6:09 am
mod_perl, LWP and HTTPS January 11, 2005, 7:35 pm
HTTPS URLs monitoring October 10, 2008, 2:20 pm
Using HTTP::Proxy September 23, 2004, 5:41 am
HTTP::Proxy and not using 127.0.0.1 May 11, 2006, 6:10 pm
DBI/DBD-Oracle and Proxy June 13, 2007, 11:43 am
PPM through Proxy (Activeperl / Activestate) July 14, 2005, 1:37 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Driving a better car - Fuelzilla.com

Cabling site for homeowners and pros alike - Cabling-Design.com

Friends:

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap
Privacy Policy