New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OpenSSL 3.0 performance issue: SSLContext.set_default_verify_paths / load_verify_locations about 5x slower #95031
Comments
|
It is a problem in OpenSSL 3.0. Python upstream does not support OpenSSL 3.0 for good reasons. It has performance and backwards compatibility issue. On my system By the way you should not combine |
import ssl
import sys
import time
LOOPS = 100
print(sys.version)
print(ssl.OPENSSL_VERSION)
ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
start = time.monotonic()
for i in range(LOOPS):
ctx.load_verify_locations('/etc/pki/tls/cert.pem')
dur = time.monotonic() - start
print(f"{LOOPS} loops of 'load_verify_locations' in {dur:0.3f}sec") |
|
Thansk.Example is separate from requests,httpx...... |
|
I recommend that you raise a bug with OpenSSL. Their |
|
According to "perf', OpenSSL 3.0 is spending a lot of time in |
Fortunately, the issue is known (so no need to report it once more): openssl/openssl#16791 initial report and openssl/openssl#18814 pointing to a root issue. |
|
Should we close this as a third party issue? |
Bug report
Example code in ubuntu20.04(openssl1.1) is much faster than ubuntu22.04(openssl3.x)
Not just speed, CPU occupancy ubuntu22.04(openssl3.x) is many times of ubuntu20.04(openssl1.1)
I'm not sure whether it's OpenSSL or Python adaptation problem
in my environment with docker:
Your environment
The text was updated successfully, but these errors were encountered: