frozenpandaman / s3s

Successor to splatnet2statink. Takes battle data from the SplatNet 3 app and uploads it to stat.ink!
https://github.com/frozenpandaman/s3s/wiki
GNU General Public License v3.0
394 stars 72 forks source link

SSLError: EOF occurred in violation of protocol #171

Closed frozenpandaman closed 6 months ago

frozenpandaman commented 6 months ago

Someone on Twitter reported this error:

Hi! So basically when I leave s3s running on -M for a while I eventually end up running into this thing. As far as I can tell it only happens then.

Traceback (most recent call last):
 File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\site-packages\urllib3\connectionpool.py", line 703, in urlopen
  httplib_response = self._make_request(
 File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\site-packages\urllib3\connectionpool.py", line 398, in _make_request
  conn.request(method, url, **httplib_request_kw)
 File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\site-packages\urllib3\connection.py", line 244, in request
  super(HTTPConnection, self).request(method, url, body=body, headers=headers)
 File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\http\client.py", line 1282, in request
  self._send_request(method, url, body, headers, encode_chunked)
 File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\http\client.py", line 1328, in _send_request
  self.endheaders(body, encode_chunked=encode_chunked)
 File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\http\client.py", line 1277, in endheaders
  self._send_output(message_body, encode_chunked=encode_chunked)
 File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\http\client.py", line 1076, in _send_output
  self.send(chunk)
 File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\http\client.py", line 998, in send
  self.sock.sendall(data)
 File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\ssl.py", line 1237, in sendall
  v = self.send(byte_view[count:])
 File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\ssl.py", line 1206, in send
  return self._sslobj.write(data)
ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:2396)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
 File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\adapters.py", line 489, in send
  resp = conn.urlopen(
 File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\site-packages\urllib3\connectionpool.py", line 787, in urlopen
  retries = retries.increment(
 File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\site-packages\urllib3\util\retry.py", line 592, in increment
  raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='stat.ink', port=443): Max retries exceeded with url: /api/v3/battle (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol >(_ssl.c:2396)')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
 File "C:\Users\username\s3s\s3s.py", line 2044, in <module>
  main()
 File "C:\Users\username\s3s\s3s.py", line 2017, in main
  monitor_battles(which, secs, blackout, test_run, skipprefetch) # skip prefetch checks if already done in -r
 File "C:\Users\username\s3s\s3s.py", line 1620, in monitor_battles
  which, cached_battles, cached_jobs, battle_wins, battle_losses, battle_draws, splatfest_wins, splatfest_losses, splatfest_draws, mirror_matches, job_successes, job_failures, >foundany=check_for_new_results(*input_params)
 File "C:\Users\username\s3s\s3s.py", line 1546, in check_for_new_results
  post_result(result, True, isblackout, istestrun) # True = is monitoring mode
 File "C:\Users\username\s3s\s3s.py", line 1221, in post_result
  postbattle = requests.post(url, headers=auth, data=msgpack.packb(payload), allow_redirects=False)
 File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\api.py", line 115, in post
  return request("post", url, data=data, json=json, **kwargs)
 File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\api.py", line 59, in request
  return session.request(method=method, url=url, **kwargs)
 File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\sessions.py", line 587, in request
  resp = self.send(prep, **send_kwargs)
 File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\sessions.py", line 701, in send
  r = adapter.send(request, **kwargs)
 File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\adapters.py", line 563, in send
  raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='stat.ink', port=443): Max retries exceeded with url: /api/v3/battle (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:2396)')))

I'm fairly sure this is not a s3s-related issue, rather something on their end or possibly stat.ink's, but making note of it here in case, and for public indexability in the future.

ADeeeee commented 6 months ago

The current certificate of stat.ink is below:

        Issuer: C = US, O = Let's Encrypt, CN = E1
        Validity
            Not Before: Feb 22 11:10:15 2024 GMT
            Not After : May 22 11:10:14 2024 GMT
        Subject: CN = stat.ink

It seems like a short turn certificate provided by Let's Encrypt and it's renewed yesterday (shoud be renewed automatically). So the error might comes out during the period between expiration and renewing. I think we could just ignore it.