Python-requests-API-proxy für https-Anfrage bekommen 407 Proxy-Authentifizierung Erforderlich

Ich habe gekämpft, mit meiner Firma-proxy, um eine https-Anfrage.

import requests
from requests.auth import HTTPProxyAuth

proxy_string = 'http://user:password@url_proxt:port_proxy'

s = requests.Session()
s.proxies = {"http": proxy_string , "https": proxy_string}
s.auth = HTTPProxyAuth(user,password)

r = s.get('http://www.google.com') # OK
print(r.text)
r = s.get('https://www.google.com',proxies={"http": proxy_string , "https": proxy_string}) #OK
print(r.text)
r = s.get('https://www.google.com') # KO
print(r.text)

Als KO, ich habe die folgende Ausnahme :

HTTPSConnectionPool(host='www.google.com', port=443): Max retries exceeded with url: / (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authentication Required',)))

Schaute ich online aber nicht finden, wenn jemand dieses spezifische Problem mit HTTPS.

Vielen Dank für Ihre Zeit

InformationsquelleAutor FabricePA | 2015-12-01

Schreibe einen Kommentar