Zero6992 / chatGPT-discord-bot

Integrate ChatGPT into your own discord bot
GNU General Public License v2.0
2.63k stars 701 forks source link

sslv3 alert handshake failure #316

Closed Arosdragon closed 1 year ago

Arosdragon commented 1 year ago

Hello, I have an issue while using unofficial, OpenAI Plus version of ChatGPT. Here's the log when doing "python3 main.py".

Someone have the same issue? Thanks!

`Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/urllib3/connectionpool.py", line 703, in urlopen
    httplib_response = self._make_request(
  File "/usr/local/lib/python3.9/dist-packages/urllib3/connectionpool.py", line 386, in _make_request
    self._validate_conn(conn)
  File "/usr/local/lib/python3.9/dist-packages/urllib3/connectionpool.py", line 1042, in _validate_conn
    conn.connect()
  File "/usr/local/lib/python3.9/dist-packages/urllib3/connection.py", line 419, in connect
    self.sock = ssl_wrap_socket(
  File "/usr/local/lib/python3.9/dist-packages/urllib3/util/ssl_.py", line 449, in ssl_wrap_socket
    ssl_sock = _ssl_wrap_socket_impl(
  File "/usr/local/lib/python3.9/dist-packages/urllib3/util/ssl_.py", line 493, in _ssl_wrap_socket_impl
    return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
  File "/usr/lib/python3.9/ssl.py", line 500, in wrap_socket
    return self.sslsocket_class._create(
  File "/usr/lib/python3.9/ssl.py", line 1040, in _create
    self.do_handshake()
  File "/usr/lib/python3.9/ssl.py", line 1309, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:1123)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/requests/adapters.py", line 489, in send
    resp = conn.urlopen(
  File "/usr/local/lib/python3.9/dist-packages/urllib3/connectionpool.py", line 787, in urlopen
    retries = retries.increment(
  File "/usr/local/lib/python3.9/dist-packages/urllib3/util/retry.py", line 592, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: 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:1123)')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/chatGPT-discord-bot/main.py", line 1, in <module>
    from src import bot
  File "/root/chatGPT-discord-bot/src/bot.py", line 5, in <module>
    from src.aclient import client
  File "/root/chatGPT-discord-bot/src/aclient.py", line 142, in <module>
    client = aclient()
  File "/root/chatGPT-discord-bot/src/aclient.py", line 32, in __init__
    self.chatbot = self.get_chatbot_model()
  File "/root/chatGPT-discord-bot/src/aclient.py", line 36, in get_chatbot_model
    return AsyncChatbot(config={"email": self.openAI_email, "password": self.openAI_password, "session_token": self.chatgpt_session_token, "model": self.openAI_gpt_engine, "paid": self.chatgpt_paid})
  File "/usr/local/lib/python3.9/dist-packages/revChatGPT/V1.py", line 679, in __init__
    super().__init__(
  File "/usr/local/lib/python3.9/dist-packages/revChatGPT/V1.py", line 58, in wrapper
    out = func(*args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/revChatGPT/V1.py", line 163, in __init__
    self.__check_credentials()
  File "/usr/local/lib/python3.9/dist-packages/revChatGPT/V1.py", line 58, in wrapper
    out = func(*args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/revChatGPT/V1.py", line 187, in __check_credentials
    self.login()
  File "/usr/local/lib/python3.9/dist-packages/revChatGPT/V1.py", line 58, in wrapper
    out = func(*args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/revChatGPT/V1.py", line 328, in login
    auth.get_access_token()
  File "/usr/local/lib/python3.9/dist-packages/OpenAIAuth.py", line 314, in get_access_token
    response = self.session.get(
  File "/usr/local/lib/python3.9/dist-packages/requests/sessions.py", line 600, in get
    return self.request("GET", url, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/requests/sessions.py", line 587, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.9/dist-packages/requests/sessions.py", line 701, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/requests/adapters.py", line 563, in send
    raise SSLError(e, request=request)
requests.exceptions.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:1123)')))
`
ebullienc3 commented 1 year ago

Fix for this?