prompt icon indicating copy to clipboard operation
prompt copied to clipboard

SSL Issue on VPN

Open jalotra opened this issue 1 year ago • 9 comments

This issue is already been discussed here : https://community.openai.com/t/ssl-certificate-verify-failed/32442/13?page=2 Tried all the methods, still not working.

StackTrace :

Traceback (most recent call last):
  File "/Users/shivam.jalotra/miniconda/lib/python3.9/site-packages/prompt/cli.py", line 43, in cli
    completion = openai.ChatCompletion.create(
  File "/Users/shivam.jalotra/miniconda/lib/python3.9/site-packages/openai/api_resources/chat_completion.py", line 25, in create
    return super().create(*args, **kwargs)
  File "/Users/shivam.jalotra/miniconda/lib/python3.9/site-packages/openai/api_resources/abstract/engine_api_resource.py", line 153, in create
    response, _, api_key = requestor.request(
  File "/Users/shivam.jalotra/miniconda/lib/python3.9/site-packages/openai/api_requestor.py", line 216, in request
    result = self.request_raw(
  File "/Users/shivam.jalotra/miniconda/lib/python3.9/site-packages/openai/api_requestor.py", line 528, in request_raw
    raise error.APIConnectionError(
openai.error.APIConnectionError: Error communicating with OpenAI: HTTPSConnectionPool(host='api.openai.com', port=443): Max retries exceeded with url: /v1/chat/completions (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1129)')))
111

jalotra avatar Mar 05 '23 07:03 jalotra

Hi,

Which OS are on ? I will try to add a flag for --no-verify in the next release. Need to check if I can overide the reuquest being sent. I will keep you posted. Thanks 😀

raiyanyahya avatar Mar 05 '23 09:03 raiyanyahya

hey I can contribute this change, CPU details : macOS running Monterey with Python 3.9 Processor : Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz

jalotra avatar Mar 05 '23 13:03 jalotra

Looked more into this, looks like OpenAI always checks for ssl certs. Permalink

jalotra avatar Mar 05 '23 14:03 jalotra

Yup .. but there are work arounds and I am look into it

raiyanyahya avatar Mar 05 '23 14:03 raiyanyahya

Update : Was not able to run with https:// enabled because setting session.verify to False also didn't worked. Changed the default adapter to http:// over here, rebuild openai-python and then use the package in prompt and also disable warnings for using http:// that openai-python is throwing.

Example Conversation : image

jalotra avatar Mar 05 '23 14:03 jalotra

Great stuff! I guess I have to wait for a fix from openai-python

raiyanyahya avatar Mar 05 '23 15:03 raiyanyahya

If you look at the dallecli that i created it uses the requests kodule to send the final request to generate images. Its not the same here. If it was i could simple provided no verify to the requests object. 🤔

raiyanyahya avatar Mar 05 '23 15:03 raiyanyahya

If you look at the dallecli that i created it uses the requests kodule to send the final request to generate images. Its not the same here. If it was i could simple provided no verify to the requests object. 🤔

Yes, that could be possible, but then you would have to call the API directly and not use the lib call the openai-python is providing right now, I think adding that capability is not a great use of time right now. Let's try to add more features, if more users see this issue could add them in the coming weeks.

jalotra avatar Mar 05 '23 16:03 jalotra

I will follow the openai issues page and see if they have a fix for this in upcoming versions.

raiyanyahya avatar Mar 05 '23 16:03 raiyanyahya