mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2025-01-30 14:58:38 +00:00
Revert to old cert names, use a subdir for test conf dir.
This commit is contained in:
parent
9b17d272a3
commit
221973aff6
@ -1,5 +1,5 @@
|
||||
import flask
|
||||
import os.path
|
||||
import os.path, os
|
||||
import proxy
|
||||
|
||||
mapp = flask.Flask(__name__)
|
||||
@ -17,12 +17,12 @@ def index():
|
||||
|
||||
@mapp.route("/cert/pem")
|
||||
def certs_pem():
|
||||
p = os.path.join(master().server.config.confdir, proxy.CONF_BASENAME + "-cert.pem")
|
||||
p = os.path.join(master().server.config.confdir, proxy.CONF_BASENAME + "-ca-cert.pem")
|
||||
return flask.Response(open(p, "rb").read(), mimetype='application/x-x509-ca-cert')
|
||||
|
||||
|
||||
@mapp.route("/cert/p12")
|
||||
def certs_p12():
|
||||
p = os.path.join(master().server.config.confdir, proxy.CONF_BASENAME + "-cert.p12")
|
||||
p = os.path.join(master().server.config.confdir, proxy.CONF_BASENAME + "-ca-cert.p12")
|
||||
return flask.Response(open(p, "rb").read(), mimetype='application/x-pkcs12')
|
||||
|
||||
|
@ -14,4 +14,3 @@ class TestApp(tservers.HTTPProxTest):
|
||||
resp = self.app("/cert/%s" % ext)
|
||||
assert resp.status_code == 200
|
||||
assert resp.content
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
import os.path
|
||||
import threading, Queue
|
||||
import shutil, tempfile
|
||||
import flask
|
||||
@ -82,7 +83,7 @@ class ProxTestBase(object):
|
||||
cls.server = libpathod.test.Daemon(ssl=cls.ssl, ssloptions=cls.ssloptions)
|
||||
cls.server2 = libpathod.test.Daemon(ssl=cls.ssl, ssloptions=cls.ssloptions)
|
||||
pconf = cls.get_proxy_config()
|
||||
cls.confdir = tempfile.gettempdir()
|
||||
cls.confdir = os.path.join(tempfile.gettempdir(), "mitmproxy")
|
||||
config = proxy.ProxyConfig(
|
||||
no_upstream_cert = cls.no_upstream_cert,
|
||||
confdir = cls.confdir,
|
||||
|
Loading…
Reference in New Issue
Block a user