Allow specifying the accepted ciphersuites

This commit is contained in:
Henrik Nordstrom 2011-02-08 16:58:38 +01:00
parent 061cea89da
commit 4ffaadd435
5 changed files with 34 additions and 5 deletions

View File

@ -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)

View File

@ -31,6 +31,11 @@ if __name__ == '__main__':
type = "str", dest="cert", default="~/.mitmproxy/cert.pem",
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,
@ -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)

View File

@ -36,6 +36,12 @@ 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,
@ -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)

View File

@ -39,6 +39,12 @@ 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,
@ -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)

View File

@ -35,6 +35,12 @@ 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,
@ -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)