How in python using requests
package to make an https request through a proxy with disabling certificate verification (analogous to the --proxy-insecure
key in curl)? My code:
import requests
requests.get('https://ip.quotaguard.com', proxies={'https': 'login:password@eu-west-shield-01.quotaguard.com:9294'}, verify=False)
verify=False
is also used, but this is not relevant to the question, since this is an analogue of the -k
switch in curl, it disables verification on ip.quotaguard.com
, and on proxy eu-west-shield-01.quotaguard.com:9294
does not.
The code throws the error ValueError: check_hostname needs a SSL context with either CERT_OPTIONAL or CERT_REQUIRED
.
Through curl, the request successfully returns the result, here is the request itself:
curl -x "https://login:password@eu-west-shield-01.quotaguard.com:9294" -L "https://ip.quotaguard.com" --proxy-insecure -k
If there is such a possibility, but not in requests
, please recommend another library.