aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Nordstrom <henrik@henriknordstrom.net>2011-02-08 16:58:38 +0100
committerHenrik Nordstrom <henrik@henriknordstrom.net>2011-02-10 02:59:51 +0100
commit4ffaadd4355e943d7fa46f3050a1fb780f4d261d (patch)
tree72a06d8dc030d381b354f33225164a7c673b7ac6
parent061cea89da96bc2ee71d9d2f065ae920aeccb311 (diff)
downloadmitmproxy-4ffaadd4355e943d7fa46f3050a1fb780f4d261d.tar.gz
mitmproxy-4ffaadd4355e943d7fa46f3050a1fb780f4d261d.tar.bz2
mitmproxy-4ffaadd4355e943d7fa46f3050a1fb780f4d261d.zip
Allow specifying the accepted ciphersuites
-rw-r--r--libmproxy/proxy.py4
-rwxr-xr-xmitmdump8
-rwxr-xr-xmitmplayback9
-rwxr-xr-xmitmproxy9
-rwxr-xr-xmitmrecord9
5 files changed, 34 insertions, 5 deletions
diff --git a/libmproxy/proxy.py b/libmproxy/proxy.py
index 631e2470..f3ea2ed2 100644
--- a/libmproxy/proxy.py
+++ b/libmproxy/proxy.py
@@ -22,8 +22,9 @@ class ProxyError(Exception):
class Config:
- def __init__(self, pemfile):
+ def __init__(self, pemfile, ciphers = None):
self.pemfile = pemfile
+ self.ciphers = ciphers
def read_chunked(fp):
@@ -520,6 +521,7 @@ class ProxyHandler(SocketServer.StreamRequestHandler):
keyfile = config.pemfile,
server_side = True,
ssl_version = ssl.PROTOCOL_SSLv23,
+ ciphers = config.ciphers,
do_handshake_on_connect = False
)
self.rfile = FileLike(self.connection)
diff --git a/mitmdump b/mitmdump
index f3e8ae0a..26686afd 100755
--- a/mitmdump
+++ b/mitmdump
@@ -32,6 +32,11 @@ if __name__ == '__main__':
help = "SSL certificate file."
)
parser.add_option(
+ "--ciphers", action="store",
+ type = "str", dest="ciphers", default=None,
+ help = "SSL ciphers."
+ )
+ parser.add_option(
"-p", "--port", action="store",
type = "int", dest="port", default=8080,
help = "Port."
@@ -54,7 +59,8 @@ if __name__ == '__main__':
utils.make_bogus_cert(certpath)
proxy.config = proxy.Config(
- certpath
+ certpath,
+ ciphers = options.ciphers
)
server = proxy.ProxyServer(options.port)
m = dump.DumpMaster(server, options.verbose)
diff --git a/mitmplayback b/mitmplayback
index ea802094..eb147cd9 100755
--- a/mitmplayback
+++ b/mitmplayback
@@ -37,6 +37,12 @@ if __name__ == '__main__':
)
parser.add_option(
+ "--ciphers", action="store",
+ type = "str", dest="ciphers", default=None,
+ help = "SSL ciphers."
+ )
+
+ parser.add_option(
"-p", "--port", action="store",
type = "int", dest="port", default=8080,
help = "Port."
@@ -68,7 +74,8 @@ if __name__ == '__main__':
utils.make_bogus_cert(certpath)
proxy.config = proxy.Config(
- certpath
+ certpath,
+ ciphers = options.ciphers
)
server = proxy.ProxyServer(options.port)
m = playback.PlaybackMaster(server, options)
diff --git a/mitmproxy b/mitmproxy
index 074a439c..e3ec9d9e 100755
--- a/mitmproxy
+++ b/mitmproxy
@@ -40,6 +40,12 @@ if __name__ == '__main__':
)
parser.add_option(
+ "--ciphers", action="store",
+ type = "str", dest="ciphers", default=None,
+ help = "SSL ciphers."
+ )
+
+ parser.add_option(
"-p", "--port", action="store",
type = "int", dest="port", default=8080,
help = "Port."
@@ -97,7 +103,8 @@ if __name__ == '__main__':
utils.make_bogus_cert(certpath)
proxy.config = proxy.Config(
- certpath
+ certpath,
+ ciphers = options.ciphers
)
if options.cache is not None:
utils.mkdir_p(options.cache)
diff --git a/mitmrecord b/mitmrecord
index 1fcfde4a..11c7b6ca 100755
--- a/mitmrecord
+++ b/mitmrecord
@@ -36,6 +36,12 @@ if __name__ == '__main__':
)
parser.add_option(
+ "--ciphers", action="store",
+ type = "str", dest="ciphers", default=None,
+ help = "SSL ciphers."
+ )
+
+ parser.add_option(
"-p", "--port", action="store",
type = "int", dest="port", default=8080,
help = "Port."
@@ -73,7 +79,8 @@ if __name__ == '__main__':
utils.make_bogus_cert(certpath)
proxy.config = proxy.Config(
- certpath
+ certpath,
+ ciphers = options.ciphers
)
server = proxy.ProxyServer(options.port)
utils.mkdir_p(options.cache)