Skip to content

Commit

Permalink
fixed nesting if statements and removed cert is none check
Browse files Browse the repository at this point in the history
  • Loading branch information
johubertj committed Feb 28, 2025
1 parent 31404eb commit 45eff50
Showing 1 changed file with 12 additions and 17 deletions.
29 changes: 12 additions & 17 deletions tests/integrationv2/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,26 +416,21 @@ def get_provider(cls):

@classmethod
def supports_protocol(cls, protocol, with_cert=None):
if cls.get_version()[0:3] == "1.1" and protocol is Protocols.SSLv3:
return False
if cls.get_version()[0:3] == "3.0" and (
protocol is Protocols.SSLv3
or protocol is Protocols.TLS10
or protocol is Protocols.TLS11
):
return False

return True
if OpenSSL.get_version()[0:3] == "1.1":
return protocol not in (Protocols.SSLv3)
elif OpenSSL.get_version()[0:3] == "3.0":
return protocol not in (Protocols.SSLv3, Protocols.TLS10, Protocols.TLS11)
else:
return True

@classmethod
def supports_certificate(cls, cert: Cert):
if cert is not None:
if OpenSSL.version_openssl[0:3] == "3.0" and (
cert is Certificates.RSA_1024_SHA256
or cert is Certificates.RSA_1024_SHA384
or cert is Certificates.RSA_1024_SHA512
):
return False
if OpenSSL.get_version()[0:3] == "3.0":
return cert not in (
Certificates.RSA_1024_SHA256,
Certificates.RSA_1024_SHA384,
Certificates.RSA_1024_SHA512,
)

return True

Expand Down

0 comments on commit 45eff50

Please sign in to comment.