1. 程式人生 > >requests.exceptions.SSLError: HTTPSConnectionPool(host='pt.morning-star.cn', port=443): Max retries

requests.exceptions.SSLError: HTTPSConnectionPool(host='pt.morning-star.cn', port=443): Max retries

Bug:

requests.exceptions.SSLError: HTTPSConnectionPool(host='pt.morning-star.cn', port=443): Max retries exceeded with url: /pt-app/api/home/getAllActivityCodes%20 (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",),))

原因:

開了Filder之類的抓包工具,或者使用了ip代理之類的

解決:

1.關閉抓包工具

2.在請求引數中設定代理為 False 如:

 requests.post(url=url,headers = headers,verify=False).json()