Python urllib2 HTTPS and proxy NTLM authentication

前端 未结 3 1443
温柔的废话
温柔的废话 2021-01-12 20:01

urllib2 doesn\'t seem to support HTTPS with proxy authentication in general, even less with NTLM authentication. Anyone knows if there is a patch somewhere for HTTPS on prox

3条回答
  •  春和景丽
    2021-01-12 20:19

    Late reply. Urllib2 does not support NTLM proxying but pycurl does. Excerpt:

    self._connection = pycurl.Curl()
    self._connection.setopt(pycurl.PROXY, PROXY_HOST)
    self._connection.setopt(pycurl.PROXYPORT, PROXY_PORT)
    self._connection.setopt(pycurl.PROXYUSERPWD,
                            "%s:%s" % (PROXY_USER, PROXY_PASS))
    ...
    

提交回复
热议问题