Skip to content

Commit 21a73bf

Browse files
committed
Make the SSL version more human-readable
1 parent 9a81fa4 commit 21a73bf

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/requests/help.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,10 @@ def info():
9393
"openssl_version": "",
9494
}
9595
if OpenSSL:
96+
openssl_version = OpenSSL.SSL.SSLeay_version(OpenSSL.SSL.SSLEAY_VERSION).decode("utf-8")
9697
pyopenssl_info = {
9798
"version": OpenSSL.__version__,
98-
"openssl_version": f"{OpenSSL.SSL.OPENSSL_VERSION_NUMBER:x}",
99+
"openssl_version": f"{openssl_version}",
99100
}
100101
cryptography_info = {
101102
"version": getattr(cryptography, "__version__", ""),
@@ -104,8 +105,8 @@ def info():
104105
"version": getattr(idna, "__version__", ""),
105106
}
106107

107-
system_ssl = ssl.OPENSSL_VERSION_NUMBER
108-
system_ssl_info = {"version": f"{system_ssl:x}" if system_ssl is not None else ""}
108+
system_ssl = ssl.OPENSSL_VERSION
109+
system_ssl_info = {"version": f"{system_ssl}"}
109110

110111
return {
111112
"platform": platform_info,

0 commit comments

Comments
 (0)