Skip to content
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

GH-452 Expose OpenSSL initialisation and deinitialisation functions #453

Merged
merged 5 commits into from
Dec 28, 2023

Conversation

h-vn
Copy link
Contributor

@h-vn h-vn commented Dec 27, 2023

Expose OpenSSL initialisation and deinitialisation functions OPENSSL_init_crypto and OPENSSL_init_ssl and their related functions. These functions were first added in OpenSSL 1.1.0 and are available when the automatic default library initialisation needs to be overridden.

Starting with Openssl 3.0.0 it seems that Net::SSLeay test 62_threads-ctx_new-deadlock.t needs to override atexit() handler to avoid crashes that happen after the test has successfully finished and the process is exiting.

Closes #452

h-vn added 5 commits December 26, 2023 19:17
…ions.

Expose multiple functions related to OpenSSL initialisation and
deinitialisation.

Add new test file 23_openssl_init.t for the newly exposed functions.
OpenSSL 3.0 added atexit() handler that appears to cause crashes with test
62_threads-ctx_new-deadlock.t.

The test is now updated to initialise OpenSSL libcrypto so that atexit()
handler is not called. As a result, OpenSSL libraries are no longer cleaned up
on exit. This is fine for the test since the process that runs it is already
exiting and the test requires no special cleaning up.
Fix the #if compilation guard to use correct OpenSSL version.
SSL_SESSION_get0_cipher is added by OpenSSL 1.1.0.
…crypto.

OPENSSL_INIT_NO_ATEXIT was added in OpenSSL 1.1.1b, therefore we need to check
for its presence rather than OPENSSL_init_crypto that was added during OpenSSL
1.1.0 development.
@h-vn h-vn added the enhancement New feature or request label Dec 27, 2023
@h-vn h-vn self-assigned this Dec 27, 2023
@h-vn h-vn merged commit 2c1ca80 into master Dec 28, 2023
883 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Work around threaded tests failing with OpenSSL 3.0
1 participant