mirror of
https://github.com/zhigang1992/mitmproxy.git
synced 2026-04-29 04:35:02 +08:00
Serve correct certs from app. Enable Windows and Android icons.
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user