You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the integrated TLS registry, it should be possible to configure Redis TLS using the TLS registry instead of the specific Redis configuration.
Implementation ideas
This is the code used for the mailer:
privatevoidconfigureTLS(Stringname, MailerRuntimeConfigconfig, TlsConfigurationRegistrytlsRegistry, MailConfigcfg,
booleanglobalTrustAll) {
TlsConfigurationconfiguration = null;
// Check if we have a named TLS configuration or a default configuration:if (config.tlsConfigurationName.isPresent()) {
Optional<TlsConfiguration> maybeConfiguration = tlsRegistry.get(config.tlsConfigurationName.get());
if (!maybeConfiguration.isPresent()) {
thrownewIllegalStateException("Unable to find the TLS configuration "
+ config.tlsConfigurationName.get() + " for the mailer " + name + ".");
}
configuration = maybeConfiguration.get();
} elseif (tlsRegistry.getDefault().isPresent() && tlsRegistry.getDefault().get().isTlsEnabled()) {
configuration = tlsRegistry.getDefault().get();
}
// Apply the configurationif (configuration != null) {
// This part is often the same (or close) for every Vert.x client:cfg.setSsl(true);
if (configuration.getTrustStoreOptions() != null) {
cfg.setTrustOptions(configuration.getTrustStoreOptions());
}
// For mTLS:if (configuration.getKeyStoreOptions() != null) {
cfg.setKeyCertOptions(configuration.getKeyStoreOptions());
}
if (configuration.isTrustAll()) {
cfg.setTrustAll(true);
}
if (configuration.getHostnameVerificationAlgorithm().isPresent()) {
// ACHTUNG HERE - this is protocol specific. The HTTP-based protocols should use HTTPS by default. cfg.setHostnameVerificationAlgorithm(configuration.getHostnameVerificationAlgorithm().get());
}
SSLOptionssslOptions = configuration.getSSLOptions();
if (sslOptions != null) {
cfg.setSslHandshakeTimeout(sslOptions.getSslHandshakeTimeout());
cfg.setSslHandshakeTimeoutUnit(sslOptions.getSslHandshakeTimeoutUnit());
for (Stringsuite : sslOptions.getEnabledCipherSuites()) {
cfg.addEnabledCipherSuite(suite);
}
for (Bufferbuffer : sslOptions.getCrlValues()) {
cfg.addCrlValue(buffer);
}
cfg.setEnabledSecureTransportProtocols(sslOptions.getEnabledSecureTransportProtocols());
}
} else {
// Mailer specific configuration (very incomplete as you can see:booleantrustAll = config.trustAll.isPresent() ? config.trustAll.get() : globalTrustAll;
cfg.setSsl(config.ssl);
cfg.setTrustAll(trustAll);
applyTruststore(config, cfg);
}
}
The text was updated successfully, but these errors were encountered:
Description
With the integrated TLS registry, it should be possible to configure Redis TLS using the TLS registry instead of the specific Redis configuration.
Implementation ideas
This is the code used for the mailer:
The text was updated successfully, but these errors were encountered: