celiao / tmdbsimple

A wrapper for The Movie Database API v3.
GNU General Public License v3.0
580 stars 121 forks source link

Getting ssl errors recently #90

Open moham96 opened 1 year ago

moham96 commented 1 year ago

I'm getting this error often:

Traceback (most recent call last):
  File "/home/cloud/.local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 703, in urlopen
    httplib_response = self._make_request(
  File "/home/cloud/.local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 386, in _make_request
    self._validate_conn(conn)
  File "/home/cloud/.local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 1040, in _validate_conn
    conn.connect()
  File "/home/cloud/.local/lib/python3.8/site-packages/urllib3/connection.py", line 414, in connect
    self.sock = ssl_wrap_socket(
  File "/home/cloud/.local/lib/python3.8/site-packages/urllib3/util/ssl_.py", line 449, in ssl_wrap_socket
    ssl_sock = _ssl_wrap_socket_impl(
  File "/home/cloud/.local/lib/python3.8/site-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.8/ssl.py", line 500, in wrap_socket
    return self.sslsocket_class._create(
  File "/usr/lib/python3.8/ssl.py", line 1040, in _create
    self.do_handshake()
  File "/usr/lib/python3.8/ssl.py", line 1309, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1131)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/cloud/.local/lib/python3.8/site-packages/requests/adapters.py", line 440, in send
    resp = conn.urlopen(
  File "/home/cloud/.local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 785, in urlopen
    retries = retries.increment(
  File "/home/cloud/.local/lib/python3.8/site-packages/urllib3/util/retry.py", line 592, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host=\'api.themoviedb.org\', port=443): Max retries exceeded with url: /3/search/multi?query=Beast&language=en&api_key=PRIVATEKEY (Caused by SSLError(SSLError(1, \'[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1131)\')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/scripts/sma/resources/../post_process/insert-to-api.py", line 359, in <module>
    main()
  File "/opt/scripts/sma/resources/../post_process/insert-to-api.py", line 209, in main
    tmdb_info = tmdbsearch.multi(
  File "/usr/local/lib/python3.8/dist-packages/tmdbsimple/search.py", line 136, in multi
    response = self._GET(path, kwargs)
  File "/usr/local/lib/python3.8/dist-packages/tmdbsimple/base.py", line 110, in _GET
    return self._request(\'GET\', path, params=params)
  File "/usr/local/lib/python3.8/dist-packages/tmdbsimple/base.py", line 87, in _request
    response = requests.request(
  File "/home/cloud/.local/lib/python3.8/site-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/home/cloud/.local/lib/python3.8/site-packages/requests/sessions.py", line 529, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/cloud/.local/lib/python3.8/site-packages/requests/sessions.py", line 645, in send
    r = adapter.send(request, **kwargs)
  File "/home/cloud/.local/lib/python3.8/site-packages/requests/adapters.py", line 517, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host=\'api.themoviedb.org\', port=443): Max retries exceeded with url: /3/search/multi?query=Beast&language=en&api_key=PRIVATEKEY (Caused by SSLError(SSLError(1, \'[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1131)\')))
celiao commented 4 months ago

Hi @moham96. Are you still receiving these errors or have you figured out the issue?