Skip to content

Fix compilation with OpenSSL 4.0+ where OPENSSL_atexit was removed - #3606

Merged
ratkosrb merged 1 commit into
vmangos:developmentfrom
zaidrain06:fix-openssl4-atexit-3605
Nov 19, 2026
Merged

ratkosrb merged 1 commit into
vmangos:developmentfrom
zaidrain06:fix-openssl4-atexit-3605

Conversation

@zaidrain06

Copy link
Copy Markdown
Contributor

🍰 Pullrequest

Fixes compilation failure on systems shipping OpenSSL 4.0+ (e.g. Arch Linux with OpenSSL 4.1.0), where OPENSSL_atexit and automatic atexit(OPENSSL_cleanup) registration were removed upstream (OpenSSL PR #29385).

  • On OpenSSL 3.x (OPENSSL_VERSION_MAJOR < 4), continues using OPENSSL_atexit(UnloadLegacyProvider) so the legacy provider is unloaded inside OPENSSL_cleanup() while the default library context still exists.
  • On OpenSSL 4.0+ (OPENSSL_VERSION_MAJOR >= 4), registers UnloadLegacyProvider via std::atexit(UnloadLegacyProvider).

Proof

Issues

How2Test

  • Build src/shared/Crypto/InitializeCrypto.cpp against OpenSSL 3.x (OPENSSL_VERSION_MAJOR == 3) and OpenSSL 4.x (OPENSSL_VERSION_MAJOR >= 4).
  • Verify mangosd / realmd startup runs Crypto::InitializeCryptoAndPrintVersion() and passes CryptoSelfCheck().

Todo / Checklist

  • None

@ratkosrb
ratkosrb merged commit 32c5ce8 into vmangos:development Nov 19, 2026
13 checks passed
zaidrain06 added a commit to zaidrain06/zaidrain06 that referenced this pull request Nov 19, 2026
Stoabrogga pushed a commit to Stoabrogga/vmangos that referenced this pull request Nov 21, 2026
Co-authored-by: Said Yagmur <zaidrain06@users.noreply.github.com>

(cherry picked from commit 32c5ce8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 [Bug] Error compiling

2 participants