Skip to content

Commit

Permalink
Server: another way to patch SSL errors
Browse files Browse the repository at this point in the history
  • Loading branch information
LifeDJIK committed Feb 21, 2024
1 parent ebfd434 commit dcc722b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
8 changes: 0 additions & 8 deletions pylon/core/tools/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,14 +496,6 @@ def run_server(context):
""" Run WSGI or Flask server """
if not context.debug and context.web_runtime == "gevent":
log.info("Starting gevent WSGI server")
#
import ssl # pylint: disable=C0415
import gevent.hub # pylint: disable=E0401,C0412,C0415
#
hub_not_errors = list(gevent.hub.Hub.NOT_ERROR)
hub_not_errors.append(ssl.SSLError)
gevent.hub.Hub.NOT_ERROR = tuple(hub_not_errors)
#
from gevent.pywsgi import WSGIServer # pylint: disable=E0401,C0412,C0415
from geventwebsocket.handler import WebSocketHandler # pylint: disable=E0401,C0412,C0415
http_server = WSGIServer(
Expand Down
7 changes: 7 additions & 0 deletions pylon/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@
#
import psycogreen.gevent # pylint: disable=E0401
psycogreen.gevent.patch_psycopg()
#
import ssl
import gevent.hub # pylint: disable=E0401
#
hub_not_errors = list(gevent.hub.Hub.NOT_ERROR)
hub_not_errors.append(ssl.SSLError)
gevent.hub.Hub.NOT_ERROR = tuple(hub_not_errors)

#
# Normal imports and code below
Expand Down

0 comments on commit dcc722b

Please sign in to comment.