andreachild commented on code in PR #3078:
URL: https://github.com/apache/tinkerpop/pull/3078#discussion_r2023689769
##########
gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java:
##########
@@ -148,8 +146,32 @@ public void init(final ServerGremlinExecutor
serverGremlinExecutor) {
configureSerializers();
// configure ssl if present
- sslContext = settings.optionalSsl().isPresent() &&
settings.ssl.enabled ?
- Optional.ofNullable(createSSLContext(settings)) :
Optional.empty();
+ if (settings.optionalSsl().isPresent() && settings.ssl.enabled) {
+ if (settings.ssl.getSslContext().isPresent()) {
+ logger.info("Using the SslContext override");
+ this.sslContext = settings.ssl.getSslContext();
+ } else {
+ final SSLFactory sslFactory =
createSSLFactoryBuilder(settings).withSwappableTrustMaterial().withSwappableIdentityMaterial().build();
+ this.sslContext = Optional.of(createSSLContext(sslFactory));
+
+ // Every minute, check if keyStore/trustStore were modified,
and if they were,
+ // reload the SSLFactory which will reload the underlying
KeyManager/TrustManager that Netty SSLHandler uses.
+ scheduledExecutorService.scheduleAtFixedRate(
+ new
SSLStoreFilesModificationWatcher(settings.ssl.keyStore,
settings.ssl.trustStore, () -> {
+ SSLFactory newSslFactory =
createSSLFactoryBuilder(settings).build();
+ try {
+ SSLFactoryUtils.reload(sslFactory,
newSslFactory);
+ } catch (RuntimeException e) {
+ logger.error("Failed to reload SSLFactory", e);
+ }
+ }),
+ 1L, 1L, TimeUnit.MINUTES
Review Comment:
Should this be a configurable setting with default of 0 to disable for
backwards compatibility?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]