Skip to content

Commit

Permalink
Serve correct certs from app. Enable Windows and Android icons.
Browse files Browse the repository at this point in the history
  • Loading branch information
cortesi committed Jan 23, 2014
1 parent 9044b8b commit 47c7e37
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions libmproxy/app.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import flask
import os.path

mapp = flask.Flask(__name__)
mapp.debug = True
Expand All @@ -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")
4 changes: 2 additions & 2 deletions libmproxy/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 47c7e37

Please sign in to comment.