GET请求带参数,请求后出现Caused by SSLError(SSLCertVerificationError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] [已解决]

运行python,发送get请求,请求后出现requests.exceptions.SSLError:  (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)')))

解决办法:


import urllib3

导包后,将urllib3.disable_warnings()写在首部

# encoding:utf-8
import requests

import urllib3

import time


urllib3.disable_warnings()

添加参数 verify=False 到请求中

response = requests.request(method='GET',
                                url='https://www.csv.com.cn/api/dc-app-order/open/up/code?signMode=1&clientId=af901bbe65jgebc3d0987a8d289&signTimestamp=123234455656&signData=hdfdgfgdgdfgfhgfh',
                                params={"outer_number":"662423253430992110","shopId":"A06J"},
                                verify=False,
                                json={"userCode": "13800000002", "password": "765496", "tag": "csv",
                                      "locale": "CN"}, headers={"Content-Type": "text/plain"})
    r = response.json()

再次运行,正常啦。遇到后解决的小问题,希望对你有帮助。

你可能感兴趣的:(ssl,服务器,网络协议)