Skip to content

configure.ac: fix libssl detection for OpenSSL 1.1.0+#317

Open
thegushi wants to merge 1 commit into
trusteddomainproject:developfrom
thegushi:issue-138-openssl-1.1-configure
Open

configure.ac: fix libssl detection for OpenSSL 1.1.0+#317
thegushi wants to merge 1 commit into
trusteddomainproject:developfrom
thegushi:issue-138-openssl-1.1-configure

Conversation

@thegushi
Copy link
Copy Markdown
Collaborator

Fixes #138.

Root cause

configure.ac probes for libssl using SSL_library_init(). In OpenSSL 1.1.0
this function was deprecated and became a no-op macro; it no longer exists as
a linkable symbol. AC_LINK_IFELSE therefore fails even when a shared libssl
is present, producing the misleading error:

Cannot build shared opendkim against static openssl libraries.

CentOS 8/9 Stream ships OpenSSL 1.1.1, which triggers this.

Fix

Replace both the AC_LINK_IFELSE probe and the AC_SEARCH_LIBS fallback
with SSL_CTX_free/SSL_CTX_new, which are real functions in all supported
OpenSSL versions (1.0.x, 1.1.x, 3.x).

Note: PR #162 (OpenSSL 3 upgrade) does not touch configure.ac for this
issue, so this fix is independent and can land first.

SSL_library_init() was deprecated in OpenSSL 1.1.0 and became a no-op
macro, causing AC_LINK_IFELSE to fail even when libssl is present and
shared.  This broke ./configure on CentOS 8/9 Stream (OpenSSL 1.1.1)
with "Cannot build shared opendkim against static openssl libraries."

Replace the probe and AC_SEARCH_LIBS symbol with SSL_CTX_new/SSL_CTX_free,
which are real functions in all supported OpenSSL versions (1.0.x, 1.1.x,
3.x).

Fixes trusteddomainproject#138
@thegushi thegushi added the needs-testing Flags things that have been fixed in develop label May 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-testing Flags things that have been fixed in develop

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant