aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/proxy/config.py
diff options
context:
space:
mode:
Diffstat (limited to 'libmproxy/proxy/config.py')
-rw-r--r--libmproxy/proxy/config.py52
1 files changed, 30 insertions, 22 deletions
diff --git a/libmproxy/proxy/config.py b/libmproxy/proxy/config.py
index 84893323..dfde2958 100644
--- a/libmproxy/proxy/config.py
+++ b/libmproxy/proxy/config.py
@@ -45,7 +45,8 @@ class ProxyConfig:
authenticator=None,
ignore_hosts=[],
tcp_hosts=[],
- ciphers=None,
+ ciphers_client=None,
+ ciphers_server=None,
certs=[],
certforward=False,
ssl_version_client="secure",
@@ -55,7 +56,8 @@ class ProxyConfig:
self.host = host
self.port = port
self.server_version = server_version
- self.ciphers = ciphers
+ self.ciphers_client = ciphers_client
+ self.ciphers_server = ciphers_server
self.clientcerts = clientcerts
self.no_upstream_cert = no_upstream_cert
self.body_size_limit = body_size_limit
@@ -83,8 +85,8 @@ class ProxyConfig:
for spec, cert in certs:
self.certstore.add_cert_file(spec, cert)
self.certforward = certforward
- self.openssl_client_method, self.openssl_client_options = version_to_openssl(ssl_version_client)
- self.openssl_server_method, self.openssl_server_options = version_to_openssl(ssl_version_server)
+ self.openssl_method_client, self.openssl_options_client = version_to_openssl(ssl_version_client)
+ self.openssl_method_server, self.openssl_options_server = version_to_openssl(ssl_version_server)
self.ssl_ports = ssl_ports
@@ -188,7 +190,8 @@ def process_proxy_options(parser, options):
ignore_hosts=options.ignore_hosts,
tcp_hosts=options.tcp_hosts,
authenticator=authenticator,
- ciphers=options.ciphers,
+ ciphers_client=options.ciphers_client,
+ ciphers_server=options.ciphers_server,
certs=certs,
certforward=options.certforward,
ssl_version_client=options.ssl_version_client,
@@ -210,19 +213,35 @@ def ssl_option_group(parser):
'Can be passed multiple times.'
)
group.add_argument(
+ "--cert-forward", action="store_true",
+ dest="certforward", default=False,
+ help="Simply forward SSL certificates from upstream."
+ )
+ group.add_argument(
+ "--ciphers-client", action="store",
+ type=str, dest="ciphers_client", default=None,
+ help="Set supported ciphers for client connections. (OpenSSL Syntax)"
+ )
+ group.add_argument(
+ "--ciphers-server", action="store",
+ type=str, dest="ciphers_server", default=None,
+ help="Set supported ciphers for server connections. (OpenSSL Syntax)"
+ )
+ group.add_argument(
"--client-certs", action="store",
type=str, dest="clientcerts", default=None,
help="Client certificate directory."
)
group.add_argument(
- "--ciphers", action="store",
- type=str, dest="ciphers", default=None,
- help="SSL cipher specification."
+ "--no-upstream-cert", default=False,
+ action="store_true", dest="no_upstream_cert",
+ help="Don't connect to upstream server to look up certificate details."
)
group.add_argument(
- "--cert-forward", action="store_true",
- dest="certforward", default=False,
- help="Simply forward SSL certificates from upstream."
+ "--ssl-port", action="append", type=int, dest="ssl_ports", default=list(TRANSPARENT_SSL_PORTS),
+ metavar="PORT",
+ help="Can be passed multiple times. Specify destination ports which are assumed to be SSL. "
+ "Defaults to %s." % str(TRANSPARENT_SSL_PORTS)
)
group.add_argument(
"--ssl-version-client", dest="ssl_version_client",
@@ -238,14 +257,3 @@ def ssl_option_group(parser):
help="Set supported SSL/TLS version for server connections. "
"SSLv2, SSLv3 and 'all' are INSECURE. Defaults to secure."
)
- group.add_argument(
- "--no-upstream-cert", default=False,
- action="store_true", dest="no_upstream_cert",
- help="Don't connect to upstream server to look up certificate details."
- )
- group.add_argument(
- "--ssl-port", action="append", type=int, dest="ssl_ports", default=list(TRANSPARENT_SSL_PORTS),
- metavar="PORT",
- help="Can be passed multiple times. Specify destination ports which are assumed to be SSL. "
- "Defaults to %s." % str(TRANSPARENT_SSL_PORTS)
- ) \ No newline at end of file