mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-27 02:24:18 +00:00
fix webapp on Windows
- the p12 file needs a ".p12" extension. simply naming the file "p12" isn't sufficient
This commit is contained in:
parent
5721e5bd27
commit
a2cbfb117b
@ -38,27 +38,31 @@ class Index(tornado.web.RequestHandler):
|
||||
|
||||
|
||||
class PEM(tornado.web.RequestHandler):
|
||||
@property
|
||||
def filename(self):
|
||||
return config.CONF_BASENAME + "-ca-cert.pem"
|
||||
|
||||
def get(self):
|
||||
p = os.path.join(
|
||||
self.request.master.server.config.cadir,
|
||||
config.CONF_BASENAME + "-ca-cert.pem"
|
||||
)
|
||||
self.set_header(
|
||||
"Content-Type", "application/x-x509-ca-cert"
|
||||
)
|
||||
self.write(open(p, "rb").read())
|
||||
p = os.path.join(self.request.master.server.config.cadir, self.filename)
|
||||
self.set_header("Content-Type", "application/x-x509-ca-cert")
|
||||
self.set_header("Content-Disposition", "attachment; filename={}".format(self.filename))
|
||||
|
||||
with open(p, "rb") as f:
|
||||
self.write(f.read())
|
||||
|
||||
|
||||
class P12(tornado.web.RequestHandler):
|
||||
@property
|
||||
def filename(self):
|
||||
return config.CONF_BASENAME + "-ca-cert.p12"
|
||||
|
||||
def get(self):
|
||||
p = os.path.join(
|
||||
self.request.master.server.config.cadir,
|
||||
config.CONF_BASENAME + "-ca-cert.p12"
|
||||
)
|
||||
self.set_header(
|
||||
"Content-Type", "application/x-pkcs12"
|
||||
)
|
||||
self.write(open(p, "rb").read())
|
||||
p = os.path.join(self.request.master.server.config.cadir, self.filename)
|
||||
self.set_header("Content-Type", "application/x-pkcs12")
|
||||
self.set_header("Content-Disposition", "attachment; filename={}".format(self.filename))
|
||||
|
||||
with open(p, "rb") as f:
|
||||
self.write(f.read())
|
||||
|
||||
|
||||
application = tornado.web.Application(
|
||||
|
Loading…
Reference in New Issue
Block a user