Implement some kind of obvious warning or even fatal error when the runtime OpenSSL major version does not match the one Python was compiled against.
Pitch
This is especially valid when using the embedded interpreter. I am developing a Node.js/Python compatiblity layer (https://github.com/mmomtchev/pymport) and Node.js exports the OpenSSL symbols it was built with. Python on Ubuntu 22.04 was compiled with libssl3 and it can't be used in any software compiled with libssl1. There is no magic solution to this problem, but printing a warning or even quitting with a fatal error would avoid wasting many hours debugging very hard to find crashes.
As we are currently right in the middle of the painful switch from OpenSSL 1 to OpenSSL 3, I am sure many will be thankful for this feature.
This could be done manually using the following code snippet.
importsslassertssl.OPENSSL_VERSION_INFO[:2] ==ssl._OPENSSL_API_VERSION[:2], "OpenSSL major version mismatch!"
Because I agree this could be useful to have this check globally when users are importing the ssl module, I've opened a PR (#100641) that addresses it.
mmomtchev commentedDec 2, 2022
•
edited by bedevere-bot
Feature or enhancement
Implement some kind of obvious warning or even fatal error when the runtime OpenSSL major version does not match the one Python was compiled against.
Pitch
This is especially valid when using the embedded interpreter. I am developing a Node.js/Python compatiblity layer (https://github.com/mmomtchev/pymport) and Node.js exports the OpenSSL symbols it was built with. Python on Ubuntu 22.04 was compiled with libssl3 and it can't be used in any software compiled with libssl1. There is no magic solution to this problem, but printing a warning or even quitting with a fatal error would avoid wasting many hours debugging very hard to find crashes.
As we are currently right in the middle of the painful switch from OpenSSL 1 to OpenSSL 3, I am sure many will be thankful for this feature.
Previous discussion
This is a two-liner
Linked PRs
The text was updated successfully, but these errors were encountered: