2014-03-10 21:36:47 +00:00
|
|
|
from __future__ import absolute_import
|
2013-03-24 20:20:26 +00:00
|
|
|
import flask
|
2014-09-03 14:57:56 +00:00
|
|
|
import os
|
2014-09-09 23:34:58 +00:00
|
|
|
from ..proxy import config
|
2013-03-24 20:20:26 +00:00
|
|
|
|
|
|
|
mapp = flask.Flask(__name__)
|
2013-07-22 22:28:35 +00:00
|
|
|
mapp.debug = True
|
|
|
|
|
2014-02-07 01:36:39 +00:00
|
|
|
|
2014-01-04 21:58:53 +00:00
|
|
|
def master():
|
|
|
|
return flask.request.environ["mitmproxy.master"]
|
2013-03-24 20:20:26 +00:00
|
|
|
|
2014-02-07 01:36:39 +00:00
|
|
|
|
2013-03-24 20:20:26 +00:00
|
|
|
@mapp.route("/")
|
2013-07-22 22:28:35 +00:00
|
|
|
def index():
|
|
|
|
return flask.render_template("index.html", section="home")
|
|
|
|
|
|
|
|
|
2014-01-05 03:59:27 +00:00
|
|
|
@mapp.route("/cert/pem")
|
|
|
|
def certs_pem():
|
2014-11-15 03:14:08 +00:00
|
|
|
p = os.path.join(master().server.config.cadir, config.CONF_BASENAME + "-ca-cert.pem")
|
2014-02-07 01:36:39 +00:00
|
|
|
return flask.Response(open(p, "rb").read(), mimetype='application/x-x509-ca-cert')
|
2014-01-05 03:59:27 +00:00
|
|
|
|
|
|
|
|
|
|
|
@mapp.route("/cert/p12")
|
|
|
|
def certs_p12():
|
2014-11-15 03:14:08 +00:00
|
|
|
p = os.path.join(master().server.config.cadir, config.CONF_BASENAME + "-ca-cert.p12")
|
2014-02-07 01:36:39 +00:00
|
|
|
return flask.Response(open(p, "rb").read(), mimetype='application/x-pkcs12')
|
2014-01-05 03:59:27 +00:00
|
|
|
|