<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://community.activestate.com" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>ActiveState Community Site - lwp https requests via proxy - Comments</title>
 <link>http://community.activestate.com/forum-topic/lwp-https-requests-proxy</link>
 <description>Comments for &quot;lwp https requests via proxy&quot;</description>
 <language>en</language>
<item>
 <title>Re: Quite a deficit on lwp&#039;s</title>
 <link>http://community.activestate.com/forum-topic/lwp-https-requests-proxy#comment-4744</link>
 <description>&lt;p&gt;What I found is that:&lt;br /&gt;
1. When HTTPS URL is accessable, LWP can work normally without setting any $ENV parameters;&lt;br /&gt;
2. When HTTPS URL is not accessable, if we want to work as well, I mean, we want to access the HTTPS URL via the proxy, we must set $ENV parameters.&lt;/p&gt;
</description>
 <pubDate>Fri, 21 Mar 2008 07:17:12 -0700</pubDate>
 <dc:creator>PeterLi9295</dc:creator>
 <guid isPermaLink="false">comment 4744 at http://community.activestate.com</guid>
</item>
<item>
 <title>Re: Quite a deficit on lwp&#039;s </title>
 <link>http://community.activestate.com/forum-topic/lwp-https-requests-proxy#comment-2821</link>
 <description>&lt;p&gt;I don&#039;t agree.  LWP doesn&#039;t need to do it, and the other proxy policy is possibly needed in some situations too.  It might be nice if it was documented near the LWP::UserAgent proxies, though...&lt;/p&gt;
</description>
 <pubDate>Mon, 10 Sep 2007 06:51:38 -0700</pubDate>
 <dc:creator>margol</dc:creator>
 <guid isPermaLink="false">comment 2821 at http://community.activestate.com</guid>
</item>
<item>
 <title>Quite a deficit on lwp&#039;s</title>
 <link>http://community.activestate.com/forum-topic/lwp-https-requests-proxy#comment-2817</link>
 <description>&lt;p&gt;Quite a deficit on lwp&#039;s side, isn&#039;t it? Anyway, finally got it working with your support- thanks! The tricky part is that lwp will still need the http_proxy to handle http requests correctly. This is working for me:&lt;/p&gt;
&lt;pre class=&quot;geshifilter&quot;&gt;$proxy = &#039;http://user:pass@server&#039;;
$ua-&amp;gt;proxy([&#039;http&#039;], $proxy);

$proxy = &#039;http://server&#039;;
$ENV{HTTPS_PROXY}		= $proxy;
$ENV{HTTPS_PROXY_USERNAME}	= user;
$ENV{HTTPS_PROXY_PASSWORD}	= pass;

# working, http &amp;amp; https
my $req = HTTP::Request-&amp;gt;new(GET =&amp;gt; &#039;http(s)://site/&#039;);
my $res = $ua-&amp;gt;request($req);
if ($res-&amp;gt;is_success){
	print $res-&amp;gt;as_string;
}&lt;/pre&gt;</description>
 <pubDate>Mon, 10 Sep 2007 01:32:53 -0700</pubDate>
 <dc:creator>andig</dc:creator>
 <guid isPermaLink="false">comment 2817 at http://community.activestate.com</guid>
</item>
<item>
 <title>Re: lwp https requests via proxy</title>
 <link>http://community.activestate.com/forum-topic/lwp-https-requests-proxy#comment-2772</link>
 <description>&lt;p&gt;You want to use LWP as if there were no proxy, and set the environment variable HTTPS_PROXY to your proxy (use HTTPS_PROXY_USERNAME and HTTPS_PROXY_PASSWORD for basic auth on the proxy).&lt;/p&gt;
&lt;p&gt;DO NOT use LWP::UserAgent-env_proxy() after doing so.&lt;/p&gt;
&lt;p&gt;This will use Crypt::SSLeay&#039;s built-in proxy support (which correctly uses CONNECT) rather than LWP&#039;s proxy support (which won&#039;t)&lt;/p&gt;
</description>
 <pubDate>Wed, 05 Sep 2007 10:45:52 -0700</pubDate>
 <dc:creator>margol</dc:creator>
 <guid isPermaLink="false">comment 2772 at http://community.activestate.com</guid>
</item>
<item>
 <title>I believe the &#039;right&#039; thing</title>
 <link>http://community.activestate.com/forum-topic/lwp-https-requests-proxy#comment-2575</link>
 <description>&lt;p&gt;I believe the &#039;right&#039; thing would be that lwp itself uses CONNECT instead of GET when using HTTPS via proxy- however this doesn&#039;t seem to happen?&lt;/p&gt;
</description>
 <pubDate>Tue, 14 Aug 2007 09:23:26 -0700</pubDate>
 <dc:creator>andig</dc:creator>
 <guid isPermaLink="false">comment 2575 at http://community.activestate.com</guid>
</item>
<item>
 <title>lwp https requests via proxy</title>
 <link>http://community.activestate.com/forum-topic/lwp-https-requests-proxy</link>
 <description>&lt;p&gt;I&#039;m trying to access an https url via proxy using LWP. Without proxy code works fine, with proxy the error message for a get request is:&lt;/p&gt;
&lt;p&gt;LWP::UserAgent::request: Simple response: Not Implemented&lt;/p&gt;
&lt;p&gt;Reading the web I realize that GET is not the correct method, it should rather be CONNECT. Now, when I CONNECT instead of getting this is fine- only the HTTP response doesn&#039;t contain a body. I assume after CONNECT, the encrypted GET request needs to be performed.&lt;/p&gt;
&lt;p&gt;So my question is: how to I perform an HTTP request to a remote web server using LWP via proxy?&lt;/p&gt;
&lt;p&gt;Current code:&lt;/p&gt;
&lt;pre class=&quot;geshifilter&quot;&gt;$proxy = &#039;http://user:pass@server&#039;;
$ua-&amp;gt;proxy([&#039;http&#039;, &#039;https&#039;], $proxy);

# HTTP/1.0 200 Connection established but no body
my $req = HTTP::Request-&amp;gt;new(CONNECT =&amp;gt; &#039;https://site/&#039;);
my $res = $ua-&amp;gt;request($req);
if ($res-&amp;gt;is_success){
	print $res-&amp;gt;as_string;
}

# error message: Failed: 501 Not Implemented
my $req = HTTP::Request-&amp;gt;new(GET =&amp;gt; &#039;https://site/&#039;);
my $res = $ua-&amp;gt;request($req);
if ($res-&amp;gt;is_success){
	print $res-&amp;gt;as_string;
}&lt;/pre&gt;</description>
 <comments>http://community.activestate.com/forum-topic/lwp-https-requests-proxy#comments</comments>
 <category domain="http://community.activestate.com/forums/perl-discussion-0">Perl discussion</category>
 <category domain="http://community.activestate.com/os/windows-xp-pro">Windows XP Pro</category>
 <pubDate>Tue, 14 Aug 2007 09:21:24 -0700</pubDate>
 <dc:creator>andig</dc:creator>
 <guid isPermaLink="false">1281 at http://community.activestate.com</guid>
</item>
</channel>
</rss>
