Skip to content

Commit 91f024a

Browse files
committed
Don´t show compliance text if SSLyze coudldn´t connect
1 parent 08b9f17 commit 91f024a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

sslyze/__main__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
ServerScanRequest,
1212
SslyzeOutputAsJson,
1313
ServerScanResultAsJson,
14+
ServerConnectivityStatusEnum,
1415
)
1516
from sslyze.json.json_output import InvalidServerStringAsJson
1617
from sslyze.mozilla_tls_profile.mozilla_config_checker import (
@@ -89,7 +90,7 @@ def main() -> None:
8990
if parsed_command_line.should_print_json_to_console:
9091
sys.exit(0)
9192

92-
if not all_server_scan_results:
93+
if {res.connectivity_status for res in all_server_scan_results} in [set(), {ServerConnectivityStatusEnum.ERROR}]:
9394
# There are no results to present: all supplied server strings were invalid?
9495
sys.exit(0)
9596

sslyze/scanner/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,11 @@ class ServerScanResult:
185185
server_location: ServerNetworkLocation
186186
network_configuration: ServerNetworkConfiguration
187187

188-
# First, SSLyze ensures that it is able to to connect to the server
188+
# First, SSLyze ensures that it is able to connect to the server
189189
connectivity_status: ServerConnectivityStatusEnum
190190
connectivity_error_trace: Optional[TracebackException]
191191
connectivity_result: Optional[ServerTlsProbingResult]
192192

193-
# If SSLyze was able to connect then it performs the TLS scan
193+
# Then, if SSLyze was able to connect, it performs the TLS scan
194194
scan_status: ServerScanStatusEnum
195195
scan_result: Optional[AllScanCommandsAttempts] # Set it the scan_status == COMPLETED

0 commit comments

Comments
 (0)