NO-JIRA Mask ssl context log passwords

This commit is contained in:
Domenico Francesco Bruscino 2020-12-02 10:30:58 +01:00 committed by Clebert Suconic
parent 1fc5458ebb
commit 383ec0870e
1 changed files with 1 additions and 1 deletions

View File

@ -44,7 +44,7 @@ public class DefaultSSLContextFactory implements SSLContextFactory {
String crlPath, String trustManagerFactoryPlugin, boolean trustAll) throws Exception { String crlPath, String trustManagerFactoryPlugin, boolean trustAll) throws Exception {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
final StringBuilder builder = new StringBuilder(); final StringBuilder builder = new StringBuilder();
configuration.forEach((k, v) -> builder.append("\r\n").append(k).append("=").append(v)); configuration.forEach((k, v) -> builder.append("\r\n").append(k).append("=").append(k.toLowerCase().contains("password") ? "****" : v));
log.debugf("Creating SSL context with configuration %s", builder.toString()); log.debugf("Creating SSL context with configuration %s", builder.toString());
} }
boolean useDefaultSslContext = ConfigurationHelper.getBooleanProperty(TransportConstants.USE_DEFAULT_SSL_CONTEXT_PROP_NAME, TransportConstants.DEFAULT_USE_DEFAULT_SSL_CONTEXT, configuration); boolean useDefaultSslContext = ConfigurationHelper.getBooleanProperty(TransportConstants.USE_DEFAULT_SSL_CONTEXT_PROP_NAME, TransportConstants.DEFAULT_USE_DEFAULT_SSL_CONTEXT, configuration);