mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-30 03:14:22 +00:00
Add SANs specification arguments to pathod
This commit is contained in:
parent
f332674ce1
commit
43dadbc2fe
@ -297,13 +297,18 @@ def args_pathod(argv, stdout=sys.stdout, stderr=sys.stderr):
|
|||||||
may include a wildcard, and is equal to "*" if not specified. The file
|
may include a wildcard, and is equal to "*" if not specified. The file
|
||||||
at path is a certificate in PEM format. If a private key is included in
|
at path is a certificate in PEM format. If a private key is included in
|
||||||
the PEM, it is used, else the default key in the conf dir is used. Can
|
the PEM, it is used, else the default key in the conf dir is used. Can
|
||||||
be passed multiple times.'
|
be passed multiple times.
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
group.add_argument(
|
group.add_argument(
|
||||||
"--ciphers", dest="ciphers", type=str, default=False,
|
"--ciphers", dest="ciphers", type=str, default=False,
|
||||||
help="SSL cipher specification"
|
help="SSL cipher specification"
|
||||||
)
|
)
|
||||||
|
group.add_argument(
|
||||||
|
"--sans", dest="sans", type=str, default="",
|
||||||
|
help="""Comma-separated list of subject Altnernate Names to add to
|
||||||
|
the server certificate."""
|
||||||
|
)
|
||||||
group.add_argument(
|
group.add_argument(
|
||||||
"--sslversion", dest="sslversion", type=int, default=4,
|
"--sslversion", dest="sslversion", type=int, default=4,
|
||||||
choices=[1, 2, 3, 4],
|
choices=[1, 2, 3, 4],
|
||||||
@ -340,6 +345,8 @@ def args_pathod(argv, stdout=sys.stdout, stderr=sys.stderr):
|
|||||||
)
|
)
|
||||||
args = parser.parse_args(argv[1:])
|
args = parser.parse_args(argv[1:])
|
||||||
|
|
||||||
|
args.sans = args.sans.split(",")
|
||||||
|
|
||||||
certs = []
|
certs = []
|
||||||
for i in args.ssl_certs:
|
for i in args.ssl_certs:
|
||||||
parts = i.split("=", 1)
|
parts = i.split("=", 1)
|
||||||
|
@ -400,7 +400,8 @@ def main(args): # pragma: nocover
|
|||||||
not_after_connect = args.ssl_not_after_connect,
|
not_after_connect = args.ssl_not_after_connect,
|
||||||
ciphers = args.ciphers,
|
ciphers = args.ciphers,
|
||||||
sslversion = utils.SSLVERSIONS[args.sslversion],
|
sslversion = utils.SSLVERSIONS[args.sslversion],
|
||||||
certs = args.ssl_certs
|
certs = args.ssl_certs,
|
||||||
|
sans = args.sans
|
||||||
)
|
)
|
||||||
|
|
||||||
root = logging.getLogger()
|
root = logging.getLogger()
|
||||||
|
Loading…
Reference in New Issue
Block a user