Skip to content

Support the OpenSSL 4.x releases and enable the self-built OpenSSL by default (#15) - #19

Merged
EndrII merged 2 commits into
mainfrom
task_15
Oct 13, 2026
Merged

EndrII merged 2 commits into
mainfrom
task_15

Conversation

@QuasarAppCI

Copy link
Copy Markdown
Member

Summary

Closes #15 (OpenSSL 4.x support).

  • cmake/BuildOpenSSL.cmake — the default EASYSSL_OPENSSL_TAG is now openssl-4.0.3 (the latest stable OpenSSL 4.x release; 4.1.0 is still beta). The no-ssl3 and no-engine options are only passed for the OpenSSL 3.x tags: in the OpenSSL 4.0 releases the SSLv3 protocol and the legacy ENGINE interface were removed, and the OpenSSL Configure script reports these options as deprecated no-ops. All the configure targets (linux-x86_64, linux-aarch64, mingw64, darwin64-*-cc, android-*, ios*-cross), the build_libs/install_sw make targets and the remaining options (no-shared, no-tests, no-ui-console, no-comp, --libdir) were verified against the openssl-4.0.3 sources.
  • CMakeLists.txt — the BUILD_WITH_OPENSSL option is enabled by default (per the maintainer comment on the issue): the OpenSSL library is self-built with the project, so the application has no runtime dependency on the system OpenSSL. Set -DBUILD_WITH_OPENSSL=0 to use the system OpenSSL 3.0+ library instead.
  • src/lib/src/public/easyssl/x509.cpp — the only code incompatibility found by the build: the X509_get_subject_name method returns a const X509_NAME * in the OpenSSL 4.x releases, so the subject name of the self-signed certificate can not be changed in place anymore. The name is now filled with a separate X509_NAME object that is set with the X509_set_subject_name/X509_set_issuer_name methods (both copy the name) and freed afterwards. The fix is compatible with the OpenSSL 3.x releases too.
  • README.md, docs/USAGE.md — the updated build options description (the new default tag, the new BUILD_WITH_OPENSSL default, the OpenSSL 3.x/4.x support).

The easyssl sources use only the EVP/X509 high level OpenSSL API, so no other code changes were required for the 4.x releases. The find_package(OpenSSL 3.0.0...<5.0.0 REQUIRED) call (used when BUILD_WITH_OPENSSL=0) already accepted the 4.x releases.

Verification

Local build with Qt 6.12 + Ninja (self-built OpenSSL 4.0.3, the new default):

  • the whole project (library + unit tests) compiles cleanly against the self-built OpenSSL 4.0.3,
  • the test binary statically links the self-built OpenSSL 4.0.3 (verified with ldd and the version string in the built libcrypto.a; the system OpenSSL 3.0.13 is not used),
  • the unit test suite: Totals: 7 passed, 0 failed, 0 skipped, 0 blacklisted (RSA/ECDSA crypto, async auth and the X509 certificate tests),
  • the OpenSSL 3.x tag path still works: configuring with -DEASYSSL_OPENSSL_TAG=openssl-3.0.9 generates the OpenSSL build with the no-ssl3/no-engine options.

The CI builds the project with -DBUILD_WITH_OPENSSL=ON on Linux and Windows, so this PR exercises the new OpenSSL 4.0.3 default end to end.

… default (#15) (task_15) [issue_15]

- cmake/BuildOpenSSL.cmake: the default EASYSSL_OPENSSL_TAG is now openssl-4.0.3 (the latest stable OpenSSL 4.x release). The no-ssl3 and no-engine options are only passed for the OpenSSL 3.x tags: in the OpenSSL 4.0 releases the SSLv3 protocol and the legacy ENGINE interface were removed and the options are deprecated no-ops. All the configure targets, the build_libs/install_sw make targets and the other options were verified against the openssl-4.0.3 sources. - CMakeLists.txt: the BUILD_WITH_OPENSSL option is enabled by default (the OpenSSL library is self-built with the project), per the maintainer request. - src/lib/src/public/easyssl/x509.cpp: the X509_get_subject_name method returns a const X509_NAME* in the OpenSSL 4.x releases, so the subject name of the self-signed certificate is now filled with a separate X509_NAME object that is set with the X509_set_subject_name/X509_set_issuer_name methods. The fix is compatible with the OpenSSL 3.x releases too. - README.md, docs/USAGE.md: the updated build options description (the new default tag, the new BUILD_WITH_OPENSSL default, the OpenSSL 3.x/4.x support).
…sl library

When the static OpenSSL libraries (the self-built OpenSSL or the
EASYSSL_STATIC_SSL option) are linked into the shared easyssl library,
the linker exports all the OpenSSL symbols (public API and internal
functions) from the shared library by default. This breaks the
coexistence with another OpenSSL in the same process (for example, the
system OpenSSL that the Qt TLS backend plugin uses): the dynamic linker
resolves the OpenSSL symbols of the other library to the embedded copies
inside the easyssl library (symbol interposition) and the mixed OpenSSL
versions corrupt the internal OpenSSL data structures at runtime
(SIGSEGV in the certificate tests on the Linux CI).

The --exclude-libs,ALL linker option keeps the symbols of the static
archives out of the dynamic symbol table of the shared library. The
easyssl public API is not affected, because it is compiled into the
shared library objects and not into the static archives.

The option is only added for the shared builds on the ELF platforms
with the GNU or the LLVM linkers (Linux, Windows (MinGW), Android and
iOS); it is not needed for the MSVC and the Apple platforms.
@QuasarAppCI QuasarAppCI mentioned this pull request Oct 12, 2026
@QuasarAppCI

Copy link
Copy Markdown
Member Author

CI update: the earlier Build and Test failure (run on a7d6a3c, SIGSEGV in crtTestX509RSA on Linux) was caused by symbol interposition: the shared libeasyssl exported the embedded self-built OpenSSL 4.0.3, which the Qt TLS plugin (linked against the system OpenSSL 3.0.13) resolved to at runtime, mixing versions and corrupting OpenSSL state. Fixed in d3ecf93 by linking the embedded static OpenSSL archives with --exclude-libs,ALL on ELF platforms. CI (Linux + Windows, Release) is green on the latest commit (d3ecf93).

@EndrII
EndrII merged commit bdf5ae6 into main Oct 13, 2026
3 checks passed
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.

OpenSSL 4.x support

2 participants