UrlLib2 Proxy and Https

news.easynet.be j_belbo at hotmail.com
Fri Dec 10 18:41:36 CET 2004


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





More information about the Python-list mailing list