From 6110a2a1bba71664c8dde69eb439bdf0c11656d6 Mon Sep 17 00:00:00 2001 From: JannisBush <33023300+JannisBush@users.noreply.github.com> Date: Mon, 30 May 2022 16:41:10 +0200 Subject: [PATCH] Fix wsgi HTTPS example (#5385) --- examples/addons/wsgi-flask-app.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/examples/addons/wsgi-flask-app.py b/examples/addons/wsgi-flask-app.py index 4ba793416..4f117f05a 100644 --- a/examples/addons/wsgi-flask-app.py +++ b/examples/addons/wsgi-flask-app.py @@ -19,9 +19,10 @@ def hello_world() -> str: addons = [ # Host app at the magic domain "example.com" on port 80. Requests to this # domain and port combination will now be routed to the WSGI app instance. - asgiapp.WSGIApp(app, "example.com", 80) - # SSL works too, but the magic domain needs to be resolvable from the mitmproxy machine due to mitmproxy's design. - # mitmproxy will connect to said domain and use serve its certificate (unless --no-upstream-cert is set) - # but won't send any data. - # mitmproxy.ctx.master.apps.add(app, "example.com", 443) + asgiapp.WSGIApp(app, "example.com", 80), + # TLS works too, but the magic domain needs to be resolvable from the mitmproxy machine due to mitmproxy's design. + # mitmproxy will connect to said domain and use its certificate but won't send any data. + # By using `--set upstream_cert=false` and `--set connection_strategy_lazy` the local certificate is used instead. + # asgiapp.WSGIApp(app, "example.com", 443), + ]