question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

A TLS-related traceback shows up during CherryPy startup on Windows 10

See original GitHub issue

❓ I’m submitting a …

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

🐞 Describe the bug. What is the current behavior?

When attempting to run cherrypy with SSL I get the error:

ConnectionAbortedError: [WinError 10053]

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

Need an HTTPS listener

πŸ’‘ To Reproduce Run the folllowing script:

import cherrypy

class RootServer:
    @cherrypy.expose
    def index(self, **keywords):
        return "it works!"

if __name__ == '__main__':
    server_config={
        'server.socket_host': '127.0.0.1',
        'server.socket_port': 8443,
        'server.ssl_certificate':'cert.pem',
        'server.ssl_private_key':'privkey.pem'
    }

    cherrypy.config.update(server_config)
    cherrypy.quickstart(RootServer())

πŸ“‹ Details

18/Jul/2020:14:01:24] ENGINE Started monitor thread 'Autoreloader'.
Exception in thread Thread-2:
Traceback (most recent call last):
  File "C:\Users\lameg\AppData\Local\Programs\Python\Python38-32\lib\threading.py", line 932, in _bootstrap_inner
    self.run()
  File "C:\Users\lameg\AppData\Local\Programs\Python\Python38-32\lib\threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\lameg\AppData\Local\Programs\Python\Python38-32\lib\site-packages\cheroot\ssl\builtin.py", line 72, in <lambda>
    target=lambda: context.wrap_socket(
  File "C:\Users\lameg\AppData\Local\Programs\Python\Python38-32\lib\ssl.py", line 500, in wrap_socket
    return self.sslsocket_class._create(
  File "C:\Users\lameg\AppData\Local\Programs\Python\Python38-32\lib\ssl.py", line 1040, in _create
    self.do_handshake()
  File "C:\Users\lameg\AppData\Local\Programs\Python\Python38-32\lib\ssl.py", line 1309, in do_handshake
    self._sslobj.do_handshake()
ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine
[18/Jul/2020:14:01:24] ENGINE Serving on https://127.0.0.1:8443

πŸ“‹ Environment

  • CherryPy version: 18.6.0
  • Python version: 3.8.3rc1
  • OS: Windows 10

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:27 (22 by maintainers)

github_iconTop GitHub Comments

1reaction
Safihrecommented, Jul 19, 2020

@webknjaz I wanted to make an issue a few days ago, but seems I forgot 😨 Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:37:02) [MSC v.1924 64 bit (AMD64)] Here is the cheroot reproducer:

from cheroot import wsgi

def my_crazy_app(environ, start_response):
    status = '200 OK'
    response_headers = [('Content-type', 'text/plain')]
    start_response(status, response_headers)
    return [b'Hello world!']

addr = '0.0.0.0', 8070
server = wsgi.Server(addr, my_crazy_app)

# the SSL stuff:
from cheroot.server import get_ssl_adapter_class
server.ssl_adapter = get_ssl_adapter_class(name='builtin')(r'C:\Users\jiriv\AppData\Local\sabnzbd\admin\server.cert', r'C:\Users\jiriv\AppData\Local\sabnzbd\admin\server.key')
server.start()

Results in:

Traceback (most recent call last):
  File "C:\Users\saf\AppData\Local\Programs\Python\Python38\lib\threading.py", line 932, in _bootstrap_inner
    self.run()
  File "C:\Users\saf\AppData\Local\Programs\Python\Python38\lib\threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\saf\Documents\GitHub\sabnzbd3\venv\lib\site-packages\cheroot\ssl\builtin.py", line 68, in <lambda>
    target=lambda: context.wrap_socket(
  File "C:\Users\saf\AppData\Local\Programs\Python\Python38\lib\ssl.py", line 500, in wrap_socket
    return self.sslsocket_class._create(
  File "C:\Users\saf\AppData\Local\Programs\Python\Python38\lib\ssl.py", line 1040, in _create
    self.do_handshake()
  File "C:\Users\saf\AppData\Local\Programs\Python\Python38\lib\ssl.py", line 1309, in do_handshake
    self._sslobj.do_handshake()
ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine
1reaction
Safihrecommented, Jul 19, 2020

@webknjaz I am seeing the same traceback on Windows with all our SABnzbd clients that have HTTPS enabled. It only started to happen after I updated our dependencies, so I think it has to do with https://github.com/cherrypy/cheroot/pull/291 Do you maybe know what is going on @mxii-ca?

Read more comments on GitHub >

github_iconTop Results From Across the Web

CherryPy silence logging not working on Windows Service
None of them work resulting in the service stopping and giving the same error as above. Am I missing something or is it...
Read more >
cherrypy._cperror module
The 'error_page' config namespace can be used to provide custom HTML output for expected responses (like 404 Not Found). Supply a filename from...
Read more >
Basics β€” CherryPy 3.2.4 documentation - Read the Docs
The following sections will drive you through the basics of a CherryPy application, introducing some essential concepts. Contents. Basics. The one-minuteΒ ...
Read more >
ChangeLog - ftp
Update TLS-related tests that were failing due to weak MDs. ... Shows up to a 10% speedup in shaping some fonts + The...
Read more >
other.xml.gz - Index of /
don't try to build showconsole on s390x(not supported by kernel) - Do not eat up argv and environ at boot logging in startproc...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found