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

[Backport 2.x] Log io.netty.internal.tcnative.SSLContext availability warning only when OpenSSL is explicitly enabled but not available #4906

Merged
merged 1 commit into from
Nov 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.apache.logging.log4j.Logger;

import org.opensearch.OpenSearchException;
import org.opensearch.common.Booleans;
import org.opensearch.common.settings.Settings;
import org.opensearch.env.Environment;
import org.opensearch.security.ssl.config.CertType;
Expand Down Expand Up @@ -374,10 +375,23 @@ void openSslWarnings(final Settings settings) {

LOGGER.debug("OpenSSL available ciphers {}", OpenSsl.availableOpenSslCipherSuites());
} else {
LOGGER.warn(
"OpenSSL not available (this is not an error, we simply fallback to built-in JDK SSL) because of {}",
OpenSsl.unavailabilityCause()
);
boolean openSslIsEnabled = false;

if (settings.hasValue(SECURITY_SSL_HTTP_ENABLE_OPENSSL_IF_AVAILABLE) == true) {
openSslIsEnabled |= Booleans.parseBoolean(settings.get(SECURITY_SSL_HTTP_ENABLE_OPENSSL_IF_AVAILABLE));
}

if (settings.hasValue(SECURITY_SSL_TRANSPORT_ENABLE_OPENSSL_IF_AVAILABLE) == true) {
openSslIsEnabled |= Booleans.parseBoolean(settings.get(SECURITY_SSL_TRANSPORT_ENABLE_OPENSSL_IF_AVAILABLE));
}

if (openSslIsEnabled == true) {
/* only print warning if OpenSsl is enabled explicitly but not available */
LOGGER.warn(
"OpenSSL not available (this is not an error, we simply fallback to built-in JDK SSL) because of ",
OpenSsl.unavailabilityCause()
);
}
}
}

Expand Down
Loading