Skip to content

ssl.SSLZeroReturnError exception on startup with builtin ssl backend python 3.8 or aboveΒ #517

Description

@toppk

❓ I'm submitting a ...

  • 🐞 bug report
  • 🐣 feature request
  • ❓ question about the decisions made in the repository

🐞 Describe the bug. What is the current behavior?
I get an exception on startup. Everything seems to be working okay.
I have attached the exception, and the code used you will need to generate an ssl cert/key pair to test.

❓ What is the motivation / use case for changing the behavior?

πŸ’‘ To Reproduce

python test.py

this is the exception so people don't have to download the attachment. the code is a basic CherryPy startup that I grabbed from #346

[17/Sep/2022:01:17:23] ENGINE Started monitor thread 'Autoreloader'.
[17/Sep/2022:01:17:23] ENGINE Serving on https://0.0.0.0:4400
[17/Sep/2022:01:17:23] ENGINE Bus STARTED
[17/Sep/2022:01:17:23] ENGINE Error in HTTPServer.serve
Traceback (most recent call last):
  File "/home/toppk/.local/lib/python3.9/site-packages/cheroot/server.py", line 1823, in serve
    self._connections.run(self.expiration_interval)
  File "/home/toppk/.local/lib/python3.9/site-packages/cheroot/connections.py", line 203, in run
    self._run(expiration_interval)
  File "/home/toppk/.local/lib/python3.9/site-packages/cheroot/connections.py", line 246, in _run
    new_conn = self._from_server_socket(self.server.socket)
  File "/home/toppk/.local/lib/python3.9/site-packages/cheroot/connections.py", line 300, in _from_server_socket
    s, ssl_env = self.server.ssl_adapter.wrap(s)
  File "/home/toppk/.local/lib/python3.9/site-packages/cheroot/ssl/builtin.py", line 277, in wrap
    s = self.context.wrap_socket(
  File "/usr/lib64/python3.9/ssl.py", line 501, in wrap_socket
    return self.sslsocket_class._create(
  File "/usr/lib64/python3.9/ssl.py", line 1041, in _create
    self.do_handshake()
  File "/usr/lib64/python3.9/ssl.py", line 1310, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLZeroReturnError: TLS/SSL connection has been closed (EOF) (_ssl.c:1129)

exception.txt
test.py.txt

πŸ’‘ Expected behavior
startup without exception

πŸ“‹ Details

πŸ“‹ Environment

  • Cheroot version: 8.6.0
  • CherryPy version: 18.6.0
  • Python version: 3.9.14
  • OS: Fedora 37 beta
  • Browser: all

πŸ“‹ Additional context
I've tried this in python3.11rc2 and python3.9, both have the issue. I do not see any similar issue if I switch to
pyopenssl backend.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is broken

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions