Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSL Issue on VPN #6

Open
jalotra opened this issue Mar 5, 2023 · 9 comments
Open

SSL Issue on VPN #6

jalotra opened this issue Mar 5, 2023 · 9 comments

Comments

@jalotra
Copy link

jalotra commented Mar 5, 2023

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
@raiyanyahya
Copy link
Owner

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 😀

@jalotra
Copy link
Author

jalotra commented Mar 5, 2023

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
Copy link
Author

jalotra commented Mar 5, 2023

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

@raiyanyahya
Copy link
Owner

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

@jalotra
Copy link
Author

jalotra commented Mar 5, 2023

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 jalotra changed the title SSL Issue on a VPN SSL Issue on VPN Mar 5, 2023
@raiyanyahya
Copy link
Owner

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

@raiyanyahya
Copy link
Owner

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. 🤔

@jalotra
Copy link
Author

jalotra commented Mar 5, 2023

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.

@raiyanyahya
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants