这里也有一拨人反馈有这个问题
https://community.openai.com/t/ssl-certificate-verify-failed/32442/72?page=2我用:
https://community.openai.com/t/ssl-certificate-verify-failed/32442/72?page=2 。这里面人提到的方法去解决,全都失败。比如:把网站证书,添加到运行环境中来
另外:wildcard 提供的每天 2000 次的接口转发服务到底能不能用?虽然看到了消耗次数,但是请求结果还是一直报错 SSl 错误
Traceback (most recent call last):
File "/home/ljk/anaconda3/envs/wechat_public_assistant/lib/python3.8/site-packages/httpx/_transports/
default.py", line 69, in map_httpcore_exceptions
yield
File "/home/ljk/anaconda3/envs/wechat_public_assistant/lib/python3.8/site-packages/httpx/_transports/
default.py", line 233, in handle_request
resp = self._pool.handle_request(req)
File "/home/ljk/anaconda3/envs/wechat_public_assistant/lib/python3.8/site-packages/httpcore/_sync/
connection_pool.py", line 216, in handle_request
raise exc from None
File "/home/ljk/anaconda3/envs/wechat_public_assistant/lib/python3.8/site-packages/httpcore/_sync/
connection_pool.py", line 196, in handle_request
response = connection.handle_request(
File "/home/ljk/anaconda3/envs/wechat_public_assistant/lib/python3.8/site-packages/httpcore/_sync/
connection.py", line 99, in handle_request
raise exc
File "/home/ljk/anaconda3/envs/wechat_public_assistant/lib/python3.8/site-packages/httpcore/_sync/
connection.py", line 76, in handle_request
stream = self._connect(request)
File "/home/ljk/anaconda3/envs/wechat_public_assistant/lib/python3.8/site-packages/httpcore/_sync/
connection.py", line 154, in _connect
stream = stream.start_tls(**kwargs)
File "/home/ljk/anaconda3/envs/wechat_public_assistant/lib/python3.8/site-packages/httpcore/_backends/
sync.py", line 168, in start_tls
raise exc
File "/home/ljk/anaconda3/envs/wechat_public_assistant/lib/python3.8/
contextlib.py", line 131, in __exit__
self.gen.throw(type, value, traceback)
File "/home/ljk/anaconda3/envs/wechat_public_assistant/lib/python3.8/site-packages/httpcore/
_exceptions.py", line 14, in map_exceptions
raise to_exc(exc) from exc
httpcore.ConnectError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1131)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/ljk/anaconda3/envs/wechat_public_assistant/lib/python3.8/site-packages/openai/
_base_client.py", line 952, in _request
response = self._client.send(
File "/home/ljk/anaconda3/envs/wechat_public_assistant/lib/python3.8/site-packages/httpx/
_client.py", line 914, in send
response = self._send_handling_auth(
File "/home/ljk/anaconda3/envs/wechat_public_assistant/lib/python3.8/site-packages/httpx/
_client.py", line 942, in _send_handling_auth
response = self._send_handling_redirects(
File "/home/ljk/anaconda3/envs/wechat_public_assistant/lib/python3.8/site-packages/httpx/
_client.py", line 979, in _send_handling_redirects
response = self._send_single_request(request)
File "/home/ljk/anaconda3/envs/wechat_public_assistant/lib/python3.8/site-packages/httpx/
_client.py", line 1015, in _send_single_request
response = transport.handle_request(request)
File "/home/ljk/anaconda3/envs/wechat_public_assistant/lib/python3.8/site-packages/httpx/_transports/
default.py", line 233, in handle_request
resp = self._pool.handle_request(req)
File "/home/ljk/anaconda3/envs/wechat_public_assistant/lib/python3.8/
contextlib.py", line 131, in __exit__
self.gen.throw(type, value, traceback)
File "/home/ljk/anaconda3/envs/wechat_public_assistant/lib/python3.8/site-packages/httpx/_transports/
default.py", line 86, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.ConnectError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1131)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/ljk/code/crawling_wechat_data/ChatGPT/
chat_with_gpt.py", line 62, in <module>
stream_gpt_responses1(api_key, base_url)
File "/home/ljk/code/crawling_wechat_data/ChatGPT/
chat_with_gpt.py", line 38, in stream_gpt_responses1
stream = client.chat.completions.create(
File "/home/ljk/anaconda3/envs/wechat_public_assistant/lib/python3.8/site-packages/openai/_utils/
_utils.py", line 277, in wrapper
return func(*args, **kwargs)
File "/home/ljk/anaconda3/envs/wechat_public_assistant/lib/python3.8/site-packages/openai/resources/chat/
completions.py", line 590, in create
return self._post(
File "/home/ljk/anaconda3/envs/wechat_public_assistant/lib/python3.8/site-packages/openai/
_base_client.py", line 1240, in post
return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
File "/home/ljk/anaconda3/envs/wechat_public_assistant/lib/python3.8/site-packages/openai/
_base_client.py", line 921, in request
return self._request(
File "/home/ljk/anaconda3/envs/wechat_public_assistant/lib/python3.8/site-packages/openai/
_base_client.py", line 976, in _request
return self._retry_request(
File "/home/ljk/anaconda3/envs/wechat_public_assistant/lib/python3.8/site-packages/openai/
_base_client.py", line 1053, in _retry_request
return self._request(
File "/home/ljk/anaconda3/envs/wechat_public_assistant/lib/python3.8/site-packages/openai/
_base_client.py", line 976, in _request
return self._retry_request(
File "/home/ljk/anaconda3/envs/wechat_public_assistant/lib/python3.8/site-packages/openai/
_base_client.py", line 1053, in _retry_request
return self._request(
File "/home/ljk/anaconda3/envs/wechat_public_assistant/lib/python3.8/site-packages/openai/
_base_client.py", line 986, in _request
raise APIConnectionError(request=request) from err
openai.APIConnectionError: Connection error.