Skip to content

Commit

Permalink
fixed comments
Browse files Browse the repository at this point in the history
  • Loading branch information
johubertj committed Feb 26, 2025
1 parent f55b829 commit c4b85d9
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions tests/integrationv2/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,11 +347,12 @@ class OpenSSL(Provider):
result = subprocess.run(
["openssl", "version"], shell=False, capture_output=True, text=True
)
# Example output of `openssl version`: "OpenSSL 3.0.8 7 Feb 2023\n"
version_str = result.stdout.split(" ")
# After splitting, version_str would be: ["OpenSSL", "3.0.8", "7", "Feb", "2023\n"]
version_str = result.stdout.split(" ")
# This will return the name of the provideer (e.g., "OpenSSL")
project = version_str[0]
# This will return the version number (e.g., "3.0.8")
version_openssl = version_str[1]
# This will return just the version number (e.g., "3.0.8")

def __init__(self, options: ProviderOptions):
Provider.__init__(self, options)
Expand Down Expand Up @@ -427,13 +428,9 @@ def supports_cipher(cls, cipher, with_curve=None):
return True

def at_least_openssl_1_1(self) -> None:
result = subprocess.run(["openssl", "version"], shell=False, capture_output=True, text=True)
version_str = result.stdout.split(" ")
project = version_str[0]
version = version_str[1]
print(f"openssl version: {project} version: {version}")
if (project != "OpenSSL" or version[0:3] < "1.1"):
raise FileNotFoundError(f"Openssl version returned {version}, expected at least 1.1.x.")
print(f"openssl version: {self.project} version: {self.version_openssl}")
if (self.project != "OpenSSL" or self.version_openssl < "1.1"):
raise FileNotFoundError(f"Openssl version returned {self.version_openssl}, expected at least 1.1.x.")

def setup_client(self):
cmd_line = ['openssl', 's_client']
Expand Down

0 comments on commit c4b85d9

Please sign in to comment.