urllib.ProxyHandler HTTPS issues

D

Devraj

Hi everyone,

I have been reading various documents/posts on the web about handling
proxy options in urllib2. Some of them suggest that urllib2 doesn't
handle HTTPS and others say it does. I have successfully written code
that relays HTTP connections via a proxy but have failed to do the
same for HTTPS connections.

Can anyone confirm if urllib2 can handle HTTPS, also if someone can
spare any code samples it will be much appreciated.

Thank you for your time Python developers :)
 
J

John J. Lee

Devraj said:
Hi everyone,

I have been reading various documents/posts on the web about handling
proxy options in urllib2. Some of them suggest that urllib2 doesn't
handle HTTPS and others say it does. I have successfully written code
that relays HTTP connections via a proxy but have failed to do the
same for HTTPS connections.

urllib2 does not support "HTTPS proxies" (it does not support use of
the CONNECT method).

Can anyone confirm if urllib2 can handle HTTPS,

Yes, it can.


John
 
D

Devraj

Thanks John. Will investigate sending the CONNECT command to handle
proxies.

Do you recommend doing this for HTTP proxies as well or should I just
use the ProxyHandler for HTTP proxies?
 
J

John J. Lee

Devraj said:
Thanks John. Will investigate sending the CONNECT command to handle
proxies.

Do you recommend doing this for HTTP proxies as well
No.


or should I just use the ProxyHandler for HTTP proxies?

Yes.


John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top