acheong08 / ChatGPT

Reverse engineered ChatGPT API
GNU General Public License v2.0
28.02k stars 4.48k forks source link

[Bug]: requests.exceptions.SSLError #996

Closed jianhai0527 closed 1 year ago

jianhai0527 commented 1 year ago

Is there an existing issue for this?

What happened?

requests.exceptions.SSLError

Steps to reproduce the problem

  1. Go to ....
  2. Press ....
  3. ...

What should have happened?

requests.exceptions.SSLError

Version where the problem happens

3.0.5

What Python version are you running this with?

3.10.9

What is your operating system ?

No response

Command Line Arguments

from revChatGPT.V1 import Chatbot
chatbot = Chatbot(config={
            "email": email,
            "password": password,
            "proxy": "socks5://127.0.0.1:13659"
        })

Console logs

requests.exceptions.SSLError: SOCKSHTTPSConnectionPool(host='explorer.api.openai.com', port=443): Max retries exceeded with url: /api/auth/csrf (Caused by SSLError(CertificateError("hostname 'explorer.api.openai.com' doesn't match either of '*.facebook.com', '*.facebook.net', '*.fbcdn.net', '*.fbsbx.com', '*.m.facebook.com', '*.messenger.com', '*.xx.fbcdn.net', '*.xy.fbcdn.net', '*.xz.fbcdn.net', 'facebook.com', 'messenger.com'")))

Additional information

No response

acheong08 commented 1 year ago

OpenAI got blocked in China completely. Use VPN or proxy

Duplicate of #987

hongyi-zhao commented 1 year ago

@acheong08

OpenAI got blocked in China completely. Use VPN or proxy

The OP has already used the proxy in him/her config, as stated below:

Command Line Arguments

from revChatGPT.V1 import Chatbot
chatbot = Chatbot(config={
            "email": email,
            "password": password,
            "proxy": "socks5://127.0.0.1:13659"
        })

I also performed the similar testing, but no error occurred:

Console logs

requests.exceptions.SSLError: SOCKSHTTPSConnectionPool(host='explorer.api.openai.com', port=443): Max retries exceeded with url: /api/auth/csrf (Caused by SSLError(CertificateError("hostname 'explorer.api.openai.com' doesn't match either of '*.facebook.com', '*.facebook.net', '*.fbcdn.net', '*.fbsbx.com', '*.m.facebook.com', '*.messenger.com', '*.xx.fbcdn.net', '*.xy.fbcdn.net', '*.xz.fbcdn.net', 'facebook.com', 'messenger.com'")))

Please compare with my following testing results:

In [1]: from revChatGPT.V1 import Chatbot

In [2]: chatbot = Chatbot(config={
   ...:             "access_token": "<access_token>",
   ...:             "proxy": "socks5h://127.0.0.1:18890"
   ...:         })

In [3]: print("Chatbot: ")
   ...: prev_text = ""
   ...: for data in chatbot.ask(
   ...:     "Hello world",
   ...: ):
   ...:     message = data["message"][len(prev_text) :]
   ...:     print(message, end="", flush=True)
   ...:     prev_text = data["message"]
   ...: print()
Chatbot: 
Hello! How can I assist you today?