Solved. I had to get the certificates from www.api.openai.com, copy them, and paste them into the Python cacert.pem file.
@PaulBellow, @freelancer.nak, thank you very much for the help.
Solved. I had to get the certificates from www.api.openai.com, copy them, and paste them into the Python cacert.pem file.
@PaulBellow, @freelancer.nak, thank you very much for the help.
Hi … the link you shared to get certificates is not working.
I tried to open www.api.openai.com by using chrome, but I got " This site can’t be reached". What can I do next?
I am trying to use the API to do text embedding for training a classification model. I obtained a new API code and use this line of code, as suggested by the API website, to test it: response = openai.Completion.create(model=“text-davinci-003”, prompt=“Say this is a test”, temperature=0, max_tokens=7, verify=False). Below is the error message I got:
APIConnectionError: Error communicating with OpenAI: HTTPSConnectionPool(host=‘api.openai.com’, port=443): Max retries exceeded with url: /v1/completions (Caused by SSLError(SSLCertVerificationError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)’)))
I am not able to put the entire trackback here for it is too long. I am using my company’s computer for this project: Windows 10 Enterprise, version 21H2, Processor: 11th Gen Intel(R) Core™ i7-11850H @ 2.50GHz 2.50 GHz. 64-bit operating system, x64-based processor.
@yuli2.chang Please get the certificates from → https://www.api.openai.com/ and add those to your system root or system certificates.
I’m getting a similar error using python. Nor can I hit the site to get the certs.
raise error.APIConnectionError(
openai.error.APIConnectionError: Error communicating with OpenAI: HTTPSConnectionPool(host=‘api.openai.com’, port=443): Max retries exceeded with url: /v1/engines/text-davinci-002/completions (Caused by SSLError(SSLCertVerificationError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:997)’)))
@freelanceer.nak Could you please mind sharing the page url from where we can download the certs ? Have tried going to the personal page (where we create the token, but to no avail). Irony of it - asked chatGPT itself the same question, and it asked me to raise a case with support.
Appreciate your response.
@aporelpan are you using a company/work laptop to connect to this API by chance. I experienced the same error and it turned out to be my company’s VPN blocking access to OpenAI API. Disabled the VPN and it worked!
I am also getting the error that SSLCertVerificationFailed.
I had to get the certificates from www.api.openai.com, copy them, and paste them into the Python cacert.pem file. The bad thing is that you have to repeat this every time they update the certificates.
I also encountered such a problem. If I run the. py file in vscode, I will get an error, but if I run the jupyter file in Chrome, it will run very well.
I use nodejs on centos7,nodejs log file: Error with OpenAI API request: Error: certificate has expired,
I update ca root certificate
yum -y install ca-certificates openssl (update version)
update-ca-trust force-enable
update-ca-trust extract
and fixed it.
You can try update ca root certificate
Thank you @PaulBellow , this resolved my problem!
search on “Certificates.command” in your Mac finder to locate the file, and you’ll need to run it as root.
None of these solutions worked for the API. I still get CERTIFICATE_VERIFY_FAILED error when using Python in a Jupyter notebook. This is on Windows using a VPN. I can get to the OpenAI playground and everything works. I added the certificate from the locations referenced above, but it would be nice if someone would post specific steps that they have used to resolve this issue. I’ve tried all the suggestions, but nothing works. I have a hard time believing this OpenAI Python library works at all.
Has anyone gotten the Python OpenAI API library to work without getting this certificate_verify_failed while also using a VPN?
Openai has got the variable verify_ssl_certs set to True and setting it to False has no effect…Wow.
Line 42 openai-python/init.py at 75c90a71e88e4194ce22c71edeb3d2dee7f6ac93 · openai/openai-python · GitHub
verify_ssl_certs = True # No effect. Certificates are always verified.
Anyone have any luck with the ssl fail error, I’ve been stuck on it for days.
Is there any other place I can get the cert from? The open AI site is just not cutting the mustard.