UrlLib2 Proxy and Https

N

news.easynet.be

Hello,

I would like to access an HTTPS site via a proxy
The following code is working for HTTP://www.hotmail.com but not for HTTPS
I have try with other sites without success

l_proxy_info = {
'user' : mylogin,
'pass' : mypassword,
'host' : myproxy,
'port' : 8080
}

l_proxy_support = urllib2.ProxyHandler({"http" : \
"http://%(user)s:%(pass)s@%(host)s:%(port)d" %
l_proxy_info})
l_opener = urllib2.build_opener(l_proxy_support, urllib2.HTTPHandler)

urllib2.install_opener(l_opener)
l_req = urllib2.urlopen('https://www.hotmail.com/')
print l_req.headers
print l_req.read()

Thanks for your help, ;-)
Jacobo
 
T

Tom

I would like to access an HTTPS site via a proxy
The following code is working for HTTP://www.hotmail.com but not for HTTPS
I have try with other sites without success

l_proxy_info = {
'user' : mylogin,
'pass' : mypassword,
'host' : myproxy,
'port' : 8080
}

I have no idea if this is your problem, but you are aware that https is
usually on port 443, not 80 or 8080 like http?

HTH

Tom
 
J

j_belbo

I have made some tests with Curl and this proxy setting is correct
It's seems that there is a problem with HTTPS and urllib2 + proxy
Bye,
Jacobo
 

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,733
Messages
2,569,440
Members
44,832
Latest member
GlennSmall

Latest Threads

Top