Skip to content

Commit

Permalink
#3582 honour flag for openssl version
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Jan 24, 2025
1 parent b03409c commit 70951a1
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions xpra/net/net_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,13 +328,6 @@ def parsenums(v: str) -> Sequence[int]:
return net_sys_config


SSL_CONV: dict[str, tuple[str, Callable]] = {
"": ("version-str", str),
"_INFO": ("version", parse_version),
"_NUMBER": ("version-number", int),
}


def get_ssl_info(show_constants=False) -> dict[str, Any]:
try:
import ssl # pylint: disable=import-outside-toplevel
Expand All @@ -361,12 +354,14 @@ def get_ssl_info(show_constants=False) -> dict[str, Any]:
v = getattr(ssl, k, None)
if v is not None:
info[name] = v
for k, idef in SSL_CONV.items():
v = getattr(ssl, f"OPENSSL_VERSION{k}", None)
if v is not None:
name, conv = idef
sslinfo = info.setdefault("openssl", {})
sslinfo[name] = conv(v)

vnum = getattr(ssl, "OPENSSL_VERSION_NUMBER", 0)
if vnum:
vparts = []
for i in range(4):
vparts.append((vnum & 0xff) >> 4)
vnum = vnum >> 8
info["openssl-version"] = tuple(reversed(vparts))[:FULL_INFO+1]
return info


Expand Down

0 comments on commit 70951a1

Please sign in to comment.