mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-26 18:18:25 +00:00
Serve correct certs from app. Enable Windows and Android icons.
This commit is contained in:
parent
9044b8b8f5
commit
47c7e37723
@ -1,4 +1,5 @@
|
||||
import flask
|
||||
import os.path
|
||||
|
||||
mapp = flask.Flask(__name__)
|
||||
mapp.debug = True
|
||||
@ -13,15 +14,14 @@ def index():
|
||||
|
||||
@mapp.route("/cert/pem")
|
||||
def certs_pem():
|
||||
p = master().server.config.cacert
|
||||
capath = master().server.config.cacert
|
||||
p = os.path.splitext(capath)[0] + "-cert.pem"
|
||||
return flask.Response(open(p).read(), mimetype='application/x-x509-ca-cert')
|
||||
|
||||
|
||||
@mapp.route("/cert/p12")
|
||||
def certs_p12():
|
||||
return flask.render_template("certs.html", section="certs")
|
||||
capath = master().server.config.cacert
|
||||
p = os.path.splitext(capath)[0] + "-cert.p12"
|
||||
return flask.Response(open(p).read(), mimetype='application/x-pkcs12')
|
||||
|
||||
|
||||
@mapp.route("/cert/cer")
|
||||
def certs_cer():
|
||||
return flask.render_template("certs.html", section="certs")
|
||||
|
@ -8,9 +8,9 @@
|
||||
<a href="/cert/pem"><i class="fa fa-apple fa-5x"></i></a>
|
||||
</p>
|
||||
|
||||
<p><i class="fa fa-windows fa-5x"></i></p>
|
||||
<p><a href="/cert/p12"><i class="fa fa-windows fa-5x"></i></a></p>
|
||||
|
||||
<p><i class="fa fa-android fa-5x"></i></p>
|
||||
<p><a href="/cert/pem"><i class="fa fa-android fa-5x"></i></a></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user