Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > urllib2, proxies and https

Reply
Thread Tools

urllib2, proxies and https

 
 
Astan Chee
Guest
Posts: n/a
 
      08-18-2006
Hi again,
According to
https://demo.launchpad.net/products/python/+bug/56872
or more specifically, the example of its working code:
http://librarian.demo.launchpad.net/..._proxy_auth.py
I can use urllib2 via proxy to access a https site(specifically hooking
it up to libgmail).
The problem is that the proxy that is accessible to me is http/port8080
only. Is it possible to use urllib2 with this proxy to access a https
site? (im guessing no, but im sure there are ways around it).
I've tried modifying the code to point to a https site
(https://mail.google.com/mail/) without changing the http proxy and it
produces a HTTP timeout error.
Despite this, if I manually use a web browser to access these sites it
prompts me with the proxy login and lets me through. So im also puzzled
here why my browser lets this happen but urllib2 doesnt.
Thanks again for all your help.
Cheers
Astan



 
Reply With Quote
 
 
 
 
John J. Lee
Guest
Posts: n/a
 
      08-20-2006
Astan Chee <(E-Mail Removed)> writes:

> Hi again,
> According to
> https://demo.launchpad.net/products/python/+bug/56872
> or more specifically, the example of its working code:
> http://librarian.demo.launchpad.net/..._proxy_auth.py
> I can use urllib2 via proxy to access a https site(specifically
> hooking it up to libgmail).

[...]

The code at that URL seems to be claiming you CAN'T do that, even with
HTTP URLs (note HTTP, not HTTPS). Hopefully (s)he is complaining
about 2.4 -- there are a bunch of bugs with this kind of thing fixed
in Python 2.5.

Re HTTPS: urllib2 does not support the CONNECT method (nor urllib, I
think), so no, you can't visit HTTPS URLS through a proxy with vanilla
urllib2. There are some hacks lying around in the cookbook and on the
Python SF tracker showing how to do it, though.


John
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem when applying Patch from issue1424152 to get https overauthenticating proxies working with urllib2 in Python 2.5 tvashtar Python 17 12-10-2013 06:15 PM
server side redirect https => https NOT working Axel ASP General 8 04-27-2009 02:02 AM
open-uri and HTTPS, or net/https with a redirect jotto Ruby 4 10-02-2006 07:26 AM
urllib2, https, and proxies Fuzzyman Python 0 06-29-2005 06:48 PM
VITAL QUESTION cgi Proxies on httpS seeker Computer Security 2 11-25-2004 11:52 AM



Advertisments