mirror of
https://github.com/smittix/intercept.git
synced 2026-04-24 06:40:00 -07:00
fix: suppress noisy SSL handshake errors in gunicorn logs
Add SSLZeroReturnError and SSLError to gevent's NOT_ERROR list so dropped TLS handshakes (browser preflight, plain HTTP to HTTPS port) don't print scary tracebacks to the console. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -10,9 +10,12 @@ def post_worker_init(worker):
|
||||
silences this harmless noise.
|
||||
"""
|
||||
try:
|
||||
import ssl
|
||||
from gevent import get_hub
|
||||
hub = get_hub()
|
||||
if SystemExit not in hub.NOT_ERROR:
|
||||
hub.NOT_ERROR = hub.NOT_ERROR + (SystemExit,)
|
||||
suppress = (SystemExit, ssl.SSLZeroReturnError, ssl.SSLError)
|
||||
for exc in suppress:
|
||||
if exc not in hub.NOT_ERROR:
|
||||
hub.NOT_ERROR = hub.NOT_ERROR + (exc,)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user