diff options
| author | Aldo Cortesi <aldo@nullcube.com> | 2013-01-05 16:48:49 +1300 |
|---|---|---|
| committer | Aldo Cortesi <aldo@nullcube.com> | 2013-01-05 16:48:49 +1300 |
| commit | 1e932e704577ff8159f93d424d4b7041dec29eea (patch) | |
| tree | 0e44bc0b17af293a4721978cd3223cf48efca625 /pathod | |
| parent | 3886ccae9379d065e54e0eb7e961992ff3c0ee62 (diff) | |
| download | mitmproxy-1e932e704577ff8159f93d424d4b7041dec29eea.tar.gz mitmproxy-1e932e704577ff8159f93d424d4b7041dec29eea.tar.bz2 mitmproxy-1e932e704577ff8159f93d424d4b7041dec29eea.zip | |
Collect SSL options into an SSLOptions object
Also split SSL cert specifications from SSL service mode - we can now enter SSL
service mode through a proxy CONNECT request as well.
Diffstat (limited to 'pathod')
| -rwxr-xr-x | pathod | 20 |
1 files changed, 9 insertions, 11 deletions
@@ -35,14 +35,11 @@ def main(parser, args): if any(sl) and not all(sl): parser.error("Both --certfile and --keyfile must be specified.") - if args.ssl: - ssloptions = dict( - keyfile = args.ssl_keyfile or utils.data.path("resources/server.key"), - certfile = args.ssl_certfile or utils.data.path("resources/server.crt"), - ssl_after_connect = args.ssl_after_connect - ) - else: - ssloptions = None + ssloptions = pathod.SSLOptions( + keyfile = args.ssl_keyfile, + certfile = args.ssl_certfile, + not_after_connect = args.ssl_not_after_connect + ) alst = [] for i in args.anchors: @@ -82,6 +79,7 @@ def main(parser, args): pd = pathod.Pathod( (args.address, args.port), craftanchor = args.craftanchor, + ssl = args.ssl, ssloptions = ssloptions, staticdir = args.staticdir, anchors = alst, @@ -158,12 +156,12 @@ if __name__ == "__main__": 'SSL', ) group.add_argument( - "-C", dest='ssl_after_connect', default=False, action="store_true", - help='Expect SSL after a CONNECT request.' + "-C", dest='ssl_not_after_connect', default=False, action="store_true", + help="Don't expect SSL after a CONNECT request." ) group.add_argument( "-s", dest='ssl', default=False, action="store_true", - help='Serve with SSL.' + help='Run in HTTPS mode.' ) group.add_argument( "--keyfile", dest='ssl_keyfile', default=None, type=str, |
