Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ssl.SSLError: [SSL: APPLICATION_DATA_AFTER_CLOSE_NOTIFY] application data after close notify (_ssl.c:2696) #291

Closed
khteh opened this issue Mar 19, 2025 · 0 comments

Comments

@khteh
Copy link

khteh commented Mar 19, 2025

Occasionally the app throws the following exception:

Traceback (most recent call last):
  File "/usr/lib/python3.12/multiprocessing/process.py", line 314, in _bootstrap
    self.run()
  File "/usr/lib/python3.12/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/home/khteh/.local/share/virtualenvs/PythonRestAPI-6TwrpjXm/lib/python3.12/site-packages/hypercorn/asyncio/run.py", line 196, in asyncio_worker
    _run(
  File "/home/khteh/.local/share/virtualenvs/PythonRestAPI-6TwrpjXm/lib/python3.12/site-packages/hypercorn/asyncio/run.py", line 234, in _run
    runner.run(main(shutdown_trigger=shutdown_trigger))
  File "/usr/lib/python3.12/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/asyncio/futures.py", line 203, in result
    raise self._exception.with_traceback(self._exception_tb)
  File "/usr/lib/python3.12/asyncio/tasks.py", line 314, in __step_run_and_handle_result
    result = coro.send(None)
             ^^^^^^^^^^^^^^^
  File "/home/khteh/.local/share/virtualenvs/PythonRestAPI-6TwrpjXm/lib/python3.12/site-packages/hypercorn/asyncio/run.py", line 171, in worker_serve
    await asyncio.wait_for(gathered_server_tasks, config.graceful_timeout)
  File "/usr/lib/python3.12/asyncio/tasks.py", line 520, in wait_for
    return await fut
           ^^^^^^^^^
  File "/usr/lib/python3.12/asyncio/tasks.py", line 385, in __wakeup
    future.result()
  File "/usr/lib/python3.12/asyncio/tasks.py", line 316, in __step_run_and_handle_result
    result = coro.throw(exc)
             ^^^^^^^^^^^^^^^
  File "/home/khteh/.local/share/virtualenvs/PythonRestAPI-6TwrpjXm/lib/python3.12/site-packages/hypercorn/asyncio/run.py", line 110, in _server_callback
    await TCPServer(app, loop, config, context, lifespan_state, reader, writer)
  File "/home/khteh/.local/share/virtualenvs/PythonRestAPI-6TwrpjXm/lib/python3.12/site-packages/hypercorn/asyncio/tcp_server.py", line 76, in run
    await self._close()
  File "/home/khteh/.local/share/virtualenvs/PythonRestAPI-6TwrpjXm/lib/python3.12/site-packages/hypercorn/asyncio/tcp_server.py", line 119, in _close
    await self.writer.wait_closed()
  File "/usr/lib/python3.12/asyncio/streams.py", line 364, in wait_closed
    await self._protocol._get_close_waiter(self)
  File "/usr/lib/python3.12/asyncio/futures.py", line 294, in __await__
    return self.result()  # May raise too.
           ^^^^^^^^^^^^^
  File "/usr/lib/python3.12/asyncio/futures.py", line 203, in result
    raise self._exception.with_traceback(self._exception_tb)
  File "/usr/lib/python3.12/asyncio/sslproto.py", line 648, in _do_shutdown
    self._sslobj.unwrap()
  File "/usr/lib/python3.12/ssl.py", line 920, in unwrap
    return self._sslobj.shutdown()
           ^^^^^^^^^^^^^^^^^^^^^^^
ssl.SSLError: [SSL: APPLICATION_DATA_AFTER_CLOSE_NOTIFY] application data after close notify (_ssl.c:2696)
@khteh khteh closed this as completed Mar 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant