SSLError: HTTPSConnectionPool(host='xx.xxx.com', port=443): Max retries exceeded with url: /api/v1/service/xxx (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1076)')))

解决方案如下:
requests请求时关闭ssl验证即可 添加参数verify=False

url = 'https://api.chatxxx.com/api/v1/service/xxx'
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer xxxxxxxxx'
}
response = requests.request("POST", url, headers=headers, data=payload,verify=False)
print(response.text)
Logo

技术共进,成长同行——讯飞AI开发者社区

更多推荐