Python Requests 信任自签名证书根证书

 

只需要将如下证书文件放到环境变量即可

export REQUESTS_CA_BUNDLE=/path/to/your/certificate.pem
python start.py

例如,当使用 xxx 时,

export REQUESTS_CA_BUNDLE="/Users/zzc/SmallSoftware/xxx/cert/CAkey.pem"
python xxx.py

该贴转自 https://stackoverflow.com/questions/30405867/how-to-get-python-requests-to-trust-a-self-signed-ssl-certificate