Page 1 of 1

Errors after enabling SSL: ssl.SSLZeroReturnError: TLS/SSL connection has been closed (EOF) (_ssl.c:997)

Posted: May 3rd, 2023, 6:41 pm
by bruiserct
Ubuntu 22.04
SABnzbd 4.0.0

I recently installed LetsEncrypt certificates. I setup the configuration under General and I am able to connect HTTPS without certificate errors. However, on the console and logs I get the following error. I am cutting out information as I am new user the forum is thinking I am posting "links" which is forbidden.

2023-05-03 19:13:19,665::ERROR::[_cplogging:213] [03/May/2023:19:13:19] ENGINE Error in HTTPServer.serve
<snip>
ssl.SSLZeroReturnError: TLS/SSL connection has been closed (EOF) (_ssl.c:997)



I am not sure what to make of it. All my packages seems to be current. Any help would be appreciated.

Re: Errors after enabling SSL

Posted: May 3rd, 2023, 7:54 pm
by sander
can you post the log on pastebin.com , and post the URL here like pastebin . com / asdfu08asdf

Make sure SAB's logging is set to +Debug

Re: Errors after enabling SSL

Posted: May 3rd, 2023, 8:20 pm
by bruiserct
Thanks for the suggestion. Below is the debug:

pastebin . com / 3UevEmuW

Re: Errors after enabling SSL

Posted: May 3rd, 2023, 11:49 pm
by sander
So https://pastebin.com/3UevEmuW

Did it also happen with the self-signed certificates?
Is the SAB webserver still reachable after the error?

Maybe useful: https://github.com/cherrypy/cheroot/issues/346 ... seems to be version dependent.

For Google reference

Code: Select all

2023-05-03 21:12:28,977::INFO::[notifier:123] Sending notification: Error - [03/May/2023:21:12:28] ENGINE Error in HTTPServer.serve
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/cheroot/server.py", line 1810, in serve
    self._connections.run(self.expiration_interval)
  File "/usr/lib/python3/dist-packages/cheroot/connections.py", line 201, in run
    self._run(expiration_interval)
  File "/usr/lib/python3/dist-packages/cheroot/connections.py", line 218, in _run
    new_conn = self._from_server_socket(self.server.socket)
  File "/usr/lib/python3/dist-packages/cheroot/connections.py", line 272, in _from_server_socket
    s, ssl_env = self.server.ssl_adapter.wrap(s)
  File "/usr/lib/python3/dist-packages/cheroot/ssl/builtin.py", line 277, in wrap
    s = self.context.wrap_socket(
  File "/usr/lib/python3.10/ssl.py", line 513, in wrap_socket
    return self.sslsocket_class._create(
  File "/usr/lib/python3.10/ssl.py", line 1071, in _create
    self.do_handshake()
  File "/usr/lib/python3.10/ssl.py", line 1342, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLZeroReturnError: TLS/SSL connection has been closed (EOF) (_ssl.c:997)
 (type=error, job_cat=None)

Re: Errors after enabling SSL

Posted: May 4th, 2023, 11:35 am
by bruiserct
I have tried the versiosn of python-cheroot with no luck. The webserver works fine, it just throws up that error on startup.

8.3.0+ds-1
8.6.0+ds1-3ubuntu1
9.0.0+ds1-2

Re: Errors after enabling SSL

Posted: May 4th, 2023, 12:24 pm
by sander
bruiserct wrote: May 4th, 2023, 11:35 am The webserver works fine, it just throws up that error on startup.
OK. Well, maybe just accept & ignore it? Errors in cheroot cannot caught be by SABnzbd. Annoying.

The newest versions of all might help a bit.

PS: you did not answer my question about self-signed.

PS2: why do you enable HTTPS? Are you accessing SAB from Internet?

Re: Errors after enabling SSL: ssl.SSLZeroReturnError: TLS/SSL connection has been closed (EOF) (_ssl.c:997)

Posted: May 4th, 2023, 3:02 pm
by bruiserct
Sorry, I have not tried self signed.

It is not Internet facing, but like to have encryption enabled where I can and with non-self signed certificates.

Ya - It is annoying, maybe someone will see this thread and have another idea. Thank you for troubleshooting with me.

Re: Errors after enabling SSL: ssl.SSLZeroReturnError: TLS/SSL connection has been closed (EOF) (_ssl.c:997)

Posted: May 5th, 2023, 7:10 am
by safihre
Unfortunately I don't think this will ever be fixed.
Cherrypy/cheroot seem near-dead projects.
Many others have also reported the same problem for already a while, but they just don't fix it.
https://github.com/cherrypy/cheroot/issues/517
I want to switch to a new framework for the webserver, but it's a lott of work and doesn't directly translate into anything for users. Except maybe getting rid of a few of these messages.

Re: Errors after enabling SSL: ssl.SSLZeroReturnError: TLS/SSL connection has been closed (EOF) (_ssl.c:997)

Posted: January 21st, 2024, 6:38 pm
by generica
Given these packages rarely get updated and given I run this in a jail and can be a bit more cavalier, I just "fixed" this by patching the cheroot builtin py to return EMPTY_RESULT at the right spot.

I tried to be helpful and post the patch inline, but "New users are not allowed to post links", which I wasn't doing.
Oh god, I can't even type builtin DOT py. It thinks it's a URL, FFS

Anyway, it has been quiet since.
YMMV

Re: Errors after enabling SSL: ssl.SSLZeroReturnError: TLS/SSL connection has been closed (EOF) (_ssl.c:997)

Posted: January 22nd, 2024, 12:39 am
by sander
generica wrote: January 21st, 2024, 6:38 pm Given these packages rarely get updated and given I run this in a jail and can be a bit more cavalier, I just "fixed" this by patching the cheroot builtin py to return EMPTY_RESULT at the right spot.

I tried to be helpful and post the patch inline, but "New users are not allowed to post links", which I wasn't doing.
Oh god, I can't even type builtin DOT py. It thinks it's a URL, FFS

Anyway, it has been quiet since.
YMMV
Yes, annoying, but needed for new posters to avoid spam Can you post it on pastebin and post the URL like pastebin . com / jdjdkjaldskf

Thanks