UrlLib2 Proxy and Https

Discussion in 'Python' started by news.easynet.be, Dec 10, 2004.

  1. 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
     
    news.easynet.be, Dec 10, 2004
    #1
    1. Advertising

  2. news.easynet.be

    Tom Guest

    > 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
     
    Tom, Dec 10, 2004
    #2
    1. Advertising

  3. news.easynet.be

    j_belbo Guest

    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
    "Tom" <> wrote in message news:mfnud.24187$...
    > > 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_belbo, Dec 10, 2004
    #3
  4. news.easynet.be

    Sandeep Guest

    Sandeep, Dec 11, 2004
    #4
  5. news.easynet.be

    Jacobo belbo Guest

    Jacobo belbo, Dec 13, 2004
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Fuzzyman

    urllib2, https, and proxies

    Fuzzyman, Jun 29, 2005, in forum: Python
    Replies:
    0
    Views:
    425
    Fuzzyman
    Jun 29, 2005
  2. Josef Cihal
    Replies:
    0
    Views:
    886
    Josef Cihal
    Sep 5, 2005
  3. Astan Chee

    urllib2, proxies and https

    Astan Chee, Aug 18, 2006, in forum: Python
    Replies:
    1
    Views:
    428
    John J. Lee
    Aug 20, 2006
  4. Replies:
    3
    Views:
    880
  5. Barry
    Replies:
    0
    Views:
    323
    Barry
    Sep 20, 2009
Loading...

Share This Page