66from enum import Enum
77from pathlib import Path
88from timeit import default_timer as timer
9- from typing import List , Tuple , Set , Optional
9+ from typing import List , Optional
1010from urllib .parse import urlparse
1111
1212import eventlet
2626from django .conf import settings
2727from django .core .cache import cache
2828from django .db import transaction
29- from nassl .ephemeral_key_info import DhEphemeralKeyInfo , EcDhEphemeralKeyInfo , OpenSslEvpPkeyEnum , EphemeralKeyInfo
29+ from nassl .ephemeral_key_info import DhEphemeralKeyInfo , EcDhEphemeralKeyInfo , OpenSslEvpPkeyEnum
3030from nassl .ssl_client import ClientCertificateRequested
3131from sslyze import (
3232 Scanner ,
9090 CERT_CURVE_MIN_KEY_SIZE ,
9191 CERT_EC_CURVES_GOOD ,
9292 CERT_CURVES_GOOD ,
93- CERT_EC_CURVES_PHASE_OUT , PROTOCOLS_GOOD , PROTOCOLS_SUFFICIENT , PROTOCOLS_PHASE_OUT ,
93+ CERT_EC_CURVES_PHASE_OUT ,
94+ PROTOCOLS_GOOD ,
95+ PROTOCOLS_SUFFICIENT ,
96+ PROTOCOLS_PHASE_OUT ,
9497)
9598from checks .tasks .shared import (
9699 aggregate_subreports ,
@@ -1669,6 +1672,7 @@ class TLSCipherOrderEvaluation:
16691672 status : CipherOrderStatus
16701673 score : scoring .Score
16711674
1675+
16721676def test_cipher_order (
16731677 server_connectivity_info : ServerConnectivityInfo ,
16741678 tls_versions : List [TlsVersionEnum ],
@@ -1686,7 +1690,7 @@ def test_cipher_order(
16861690 score = scoring .WEB_TLS_CIPHER_ORDER_GOOD ,
16871691 )
16881692
1689- tls_version = sorted ([t for t in tls_versions if t != TlsVersionEnum .TLS_1_3 ], key = lambda t : t .value , reverse = True )[ 0 ]
1693+ tls_version = sorted ([t for t in tls_versions if t != TlsVersionEnum .TLS_1_3 ], key = lambda t : t .value )[ - 1 ]
16901694
16911695 order_tuples = [
16921696 (
0 commit comments