aboutsummaryrefslogtreecommitdiffstats
path: root/mitmproxy
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@corte.si>2018-05-10 11:39:55 +1200
committerAldo Cortesi <aldo@corte.si>2018-05-10 11:40:33 +1200
commit9830e5b597ffbfae1781eb486c8cd8b0ba3c5dc7 (patch)
tree50e314493c7d17f01f4440f4798c5dc8bfd02be4 /mitmproxy
parent3438912236a25d7d3bcbff3238156b9eae2bc3d5 (diff)
downloadmitmproxy-9830e5b597ffbfae1781eb486c8cd8b0ba3c5dc7.tar.gz
mitmproxy-9830e5b597ffbfae1781eb486c8cd8b0ba3c5dc7.tar.bz2
mitmproxy-9830e5b597ffbfae1781eb486c8cd8b0ba3c5dc7.zip
cadir -> confdir
We store a lot more than just the CAs in our configuration directory. Clarify the option name.
Diffstat (limited to 'mitmproxy')
-rw-r--r--mitmproxy/addons/core.py2
-rw-r--r--mitmproxy/addons/onboardingapp/app.py8
-rw-r--r--mitmproxy/net/tls.py2
-rw-r--r--mitmproxy/options.py8
-rw-r--r--mitmproxy/proxy/config.py2
-rw-r--r--mitmproxy/tools/cmdline.py2
-rw-r--r--mitmproxy/utils/arg_check.py6
7 files changed, 15 insertions, 15 deletions
diff --git a/mitmproxy/addons/core.py b/mitmproxy/addons/core.py
index 53567680..0322b4ce 100644
--- a/mitmproxy/addons/core.py
+++ b/mitmproxy/addons/core.py
@@ -14,7 +14,7 @@ from mitmproxy.net.http import status_codes
import mitmproxy.types
-CA_DIR = "~/.mitmproxy"
+CONF_DIR = "~/.mitmproxy"
LISTEN_PORT = 8080
diff --git a/mitmproxy/addons/onboardingapp/app.py b/mitmproxy/addons/onboardingapp/app.py
index 0f09e32c..ab136778 100644
--- a/mitmproxy/addons/onboardingapp/app.py
+++ b/mitmproxy/addons/onboardingapp/app.py
@@ -45,7 +45,7 @@ class PEM(tornado.web.RequestHandler):
return config.CONF_BASENAME + "-ca-cert.pem"
def head(self):
- p = os.path.join(self.request.master.options.cadir, self.filename)
+ p = os.path.join(self.request.master.options.confdir, self.filename)
p = os.path.expanduser(p)
content_length = os.path.getsize(p)
@@ -57,7 +57,7 @@ class PEM(tornado.web.RequestHandler):
self.set_header("Content-Length", content_length)
def get(self):
- p = os.path.join(self.request.master.options.cadir, self.filename)
+ p = os.path.join(self.request.master.options.confdir, self.filename)
p = os.path.expanduser(p)
self.set_header("Content-Type", "application/x-x509-ca-cert")
self.set_header(
@@ -76,7 +76,7 @@ class P12(tornado.web.RequestHandler):
return config.CONF_BASENAME + "-ca-cert.p12"
def head(self):
- p = os.path.join(self.request.master.options.cadir, self.filename)
+ p = os.path.join(self.request.master.options.confdir, self.filename)
p = os.path.expanduser(p)
content_length = os.path.getsize(p)
@@ -89,7 +89,7 @@ class P12(tornado.web.RequestHandler):
self.set_header("Content-Length", content_length)
def get(self):
- p = os.path.join(self.request.master.options.cadir, self.filename)
+ p = os.path.join(self.request.master.options.confdir, self.filename)
p = os.path.expanduser(p)
self.set_header("Content-Type", "application/x-pkcs12")
self.set_header(
diff --git a/mitmproxy/net/tls.py b/mitmproxy/net/tls.py
index 026651a6..4dc61969 100644
--- a/mitmproxy/net/tls.py
+++ b/mitmproxy/net/tls.py
@@ -71,7 +71,7 @@ def client_arguments_from_options(options: "mitmproxy.options.Options") -> dict:
"verify": verify,
"method": method,
"options": tls_options,
- "ca_path": options.ssl_verify_upstream_trusted_cadir,
+ "ca_path": options.ssl_verify_upstream_trusted_confdir,
"ca_pemfile": options.ssl_verify_upstream_trusted_ca,
"client_certs": options.client_certs,
"cipher_list": options.ciphers_server,
diff --git a/mitmproxy/options.py b/mitmproxy/options.py
index ce7597a8..047a44cd 100644
--- a/mitmproxy/options.py
+++ b/mitmproxy/options.py
@@ -4,7 +4,7 @@ from mitmproxy import optmanager
from mitmproxy.net import tls
-CA_DIR = "~/.mitmproxy"
+CONF_DIR = "~/.mitmproxy"
LISTEN_PORT = 8080
@@ -30,8 +30,8 @@ class Options(optmanager.OptManager):
"""
)
self.add_option(
- "cadir", str, CA_DIR,
- "Location of the default mitmproxy CA files."
+ "confdir", str, CONF_DIR,
+ "Location of the default mitmproxy configuration files."
)
self.add_option(
"certs", Sequence[str], [],
@@ -143,7 +143,7 @@ class Options(optmanager.OptManager):
"Do not verify upstream server SSL/TLS certificates."
)
self.add_option(
- "ssl_verify_upstream_trusted_cadir", Optional[str], None,
+ "ssl_verify_upstream_trusted_confdir", Optional[str], None,
"""
Path to a directory of trusted CA certificates for upstream server
verification prepared using the c_rehash tool.
diff --git a/mitmproxy/proxy/config.py b/mitmproxy/proxy/config.py
index 22823f4c..f32d3086 100644
--- a/mitmproxy/proxy/config.py
+++ b/mitmproxy/proxy/config.py
@@ -49,7 +49,7 @@ class ProxyConfig:
if "tcp_hosts" in updated:
self.check_tcp = HostMatcher(options.tcp_hosts)
- certstore_path = os.path.expanduser(options.cadir)
+ certstore_path = os.path.expanduser(options.confdir)
if not os.path.exists(os.path.dirname(certstore_path)):
raise exceptions.OptionsError(
"Certificate Authority parent directory does not exist: %s" %
diff --git a/mitmproxy/tools/cmdline.py b/mitmproxy/tools/cmdline.py
index 4b7598cf..4a97a8ff 100644
--- a/mitmproxy/tools/cmdline.py
+++ b/mitmproxy/tools/cmdline.py
@@ -4,7 +4,7 @@ import os
from mitmproxy.addons import core
-CONFIG_PATH = os.path.join(core.CA_DIR, "config.yaml")
+CONFIG_PATH = os.path.join(core.CONF_DIR, "config.yaml")
def common_options(parser, opts):
diff --git a/mitmproxy/utils/arg_check.py b/mitmproxy/utils/arg_check.py
index 9c582c4c..123ae265 100644
--- a/mitmproxy/utils/arg_check.py
+++ b/mitmproxy/utils/arg_check.py
@@ -1,7 +1,7 @@
import sys
DEPRECATED = """
---cadir
+--confdir
-Z
--body-size-limit
--stream
@@ -22,7 +22,7 @@ DEPRECATED = """
--client-certs
--no-upstream-cert
--add-upstream-certs-to-client-chain
---upstream-trusted-cadir
+--upstream-trusted-confdir
--upstream-trusted-ca
--ssl-version-client
--ssl-version-server
@@ -72,7 +72,7 @@ REPLACEMENTS = {
"--no-http2-priority": "http2_priority",
"--no-websocket": "websocket",
"--no-upstream-cert": "upstream_cert",
- "--upstream-trusted-cadir": "ssl_verify_upstream_trusted_cadir",
+ "--upstream-trusted-confdir": "ssl_verify_upstream_trusted_confdir",
"--upstream-trusted-ca": "ssl_verify_upstream_trusted_ca",
"--no-onboarding": "onboarding",
"--no-pop": "server_replay_nopop",