Skip to content

Commit 1fcc536

Browse files
committed
fail sites with SSL Labs grade of F
1 parent 1da1445 commit 1fcc536

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎check_https.py‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,11 @@ def check_secure_connection(info):
169169
secure_sock.close()
170170
msg = "A verified TLS connection can be established. "
171171
if info.ssllabs_grade is not None:
172-
msg += "<a href=\"https://www.ssllabs.com/ssltest/analyze.html?d={}\">SSL Labs grade</a> is " + info.ssllabs_grade + "."
172+
grade_msg = "<a href=\"https://www.ssllabs.com/ssltest/analyze.html?d={}\">SSL Labs grade</a> is " + info.ssllabs_grade + "."
173+
if info.ssllabs_grade == "F":
174+
good_connection.fail(grade_msg.format(info.domain))
175+
return
176+
msg += grade_msg
173177
else:
174178
msg += "(<a href=\"https://www.ssllabs.com/ssltest/analyze.html?d={}\">SSL Labs report</a>)"
175179
info.secure_connection_works = True

0 commit comments

Comments
 (0)