Skip to content

Commit

Permalink
[#551] Add support for --mozilla_config disable
Browse files Browse the repository at this point in the history
  • Loading branch information
nabla-c0d3 committed Mar 13, 2022
1 parent c33cf28 commit 2002b0e
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion sslyze/__main__.py
Original file line number Diff line number Diff line change
@@ -100,7 +100,7 @@ def main() -> None:
print()
print(title)
if not parsed_command_line.check_against_mozilla_config:
print(" Disabled; use --mozilla-config={old, intermediate, modern}.\n")
print(" Disabled; use --mozilla_config={old, intermediate, modern}.\n")
else:

print(
11 changes: 8 additions & 3 deletions sslyze/cli/command_line_parser.py
Original file line number Diff line number Diff line change
@@ -103,9 +103,10 @@ def __init__(self, sslyze_version: str) -> None:
"--mozilla_config",
action="store",
dest="mozilla_config",
choices=[config.value for config in MozillaTlsConfigurationEnum],
choices=[config.value for config in MozillaTlsConfigurationEnum] + ["disable"],
help="Shortcut to queue various scan commands needed to check the server's TLS configurations against one"
' of Mozilla\'s recommended TLS configuration. Set to "intermediate" by default.',
' of Mozilla\'s recommended TLS configuration. Set to "intermediate" by default. Use "disable" to disable'
' this check.',
)

self.aparser.add_argument(dest="target", default=[], nargs="*", help="The list of servers to scan.")
@@ -151,7 +152,11 @@ def parse_command_line(self) -> ParsedCommandLine:
# Enable the commands needed by --mozilla-config
check_against_mozilla_config: Optional[MozillaTlsConfigurationEnum] = None
if args_command_list.mozilla_config:
check_against_mozilla_config = MozillaTlsConfigurationEnum(args_command_list.mozilla_config)
if args_command_list.mozilla_config == "disable":
check_against_mozilla_config = None
else:
check_against_mozilla_config = MozillaTlsConfigurationEnum(args_command_list.mozilla_config)

for scan_cmd in SCAN_COMMANDS_NEEDED_BY_MOZILLA_CHECKER:
cli_connector_cls = ScanCommandsRepository.get_implementation_cls(scan_cmd).cli_connector_cls
setattr(args_command_list, cli_connector_cls._cli_option, True)

0 comments on commit 2002b0e

Please sign in to comment.