What is the best way to specify a proxy with username and password for ** https ** connection in python?

I read somewhere that urllib2 currently does not support authenticated https connection. My proxy uses only basic authentication, but how to open an https based web page through it. Please help me.

Thanks.

+3
source share
2 answers

"urllib2 does not support authenticated https connection" False.

    # Build Handler to support HTTP Basic Authentication...
    basic_handler = urllib2.HTTPBasicAuthHandler()
    basic_handler.add_password(realm, self.urlBase, username, password)
    # Get cookies, also, to handle login
    self.cookies= cookielib.CookieJar()
    cookie_handler= urllib2.HTTPCookieProcessor( self.cookies )
    # Assemble the final opener
    opener = urllib2.build_opener(basic_handler,cookie_handler)
+2
source

httplib2, urllib2, . , https.

0

All Articles