SSL handshake failure while connecting to OpenAI API server using Brave browser
xshapira opened this issue · 14 comments
It seems there’s an SSL handshake failure while attempting to establish a secure connection with the OpenAI API server.
When running the following command:
aishell 'print Hello World'I'm getting this error:
SSLError: HTTPSConnectionPool(host='explorer.api.openai.com', port=443): Max retries
exceeded with url: /api/auth/session (Caused by SSLError(SSLError(1, '[SSL:
SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:992)')))Are there any specific Brave browser settings that could be causing this issue?
Guess the problem of revChatGPT? have you tried with the openai official api or the reverse engineered api?
Sorry for the late answer BTW
having the same issue! I am using the reverse engineering one.
Browser: Firefox
SSLError: HTTPSConnectionPool(host='explorer.api.openai.com', port=443): Max retries exceeded with url: /api/auth/session (Caused by SSLError(SSLError(1, '[SSL:
SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:992)')))
Currently recommend to use Official API, but i am looking into this and will fix ASAP. sorry 😞
- The
cookie parsingfeature retrieves the 'session token` from the given browser. - The
session tokenno longer works as OpenAI's ChatGPT authentication method access tokennow works instead ofsession token- Since
access tokencan be expired easily, I think I have to add an option to the AiShell Config:default browserand to retrieve access token, every time the user queries.
I am super busy now so expecting to be fixed not very soon, so now just recommend to use Official API. 😓 Thanks!
As a solution of this, I am thinking of:
- Update config json like following
{
"language_model": "reverse_engineered_chatgpt",
"openai_api_key": null,
"browser": "brave" // firefox, chrome, safari or whatever
}- Replace session token retrieving code as access token retrieving code
- Using the browser's cookie, send request to
https://chat.openai.com/api/auth/sessionto get the access token
- Send request to ChatGPT using configured information from 2
As a solution of this, I am thinking of:
- Update config json like following
{ "language_model": "reverse_engineered_chatgpt", "openai_api_key": null, "browser": "brave" // firefox, chrome, safari or whatever }
- Replace session token retrieving code as access token retrieving code
- Using the browser's cookie, send request to
https://chat.openai.com/api/auth/sessionto get the access token
- Send request to ChatGPT using configured information from 2
This looks good! Reverse engineering is really useful for ChatGPT Plus subscribers. Do you know when you'll release an update?
Thanks for the hard work 👍
I am guessing within a week! 👍 Thank you 🙌
@xshapira FYI, before I update, You can use aishell by doing following:
- You can visit https://chat.openai.com/api/auth/session to get the access token
- and manually set access token into the json file (
~/.aishell_config.json)
@xshapira FYI, before I update, You can use aishell by doing following:
- You can visit https://chat.openai.com/api/auth/session to get the access token
- and manually set access token into the json file (
~/.aishell_config.json)
I followed your instructions but got this error (have the same issue with the younger brother of this project, YGK-a):
it definetely looks like because of the version of revchatgpt, i am going to bump up that.
Just released new version with version up. Guess now it's gonna work.
Plus, if you have further issues with YGK-a, please issue it on YGK-a. Thanks!
Just released new version with version up. Guess now it's gonna work.
Plus, if you have further issues with
YGK-a, please issue it onYGK-a. Thanks!
Works like a charm! Thank you 👍
Hey @xshapira! I've just released a new version featuring automatic browser login using access tokens! #56
Now, every time you make a request, it retrieves a fresh access token using your credentials from your chosen browser. Although this is a breaking change, you'll need to set up AiShell once more, but it shouldn't be too bothersome as all you need to do is select your preferred browser. And this patch also have done to ygka too. (They now share the same config)
Thank you for using the AiShell!