andreachild commented on code in PR #3078:
URL: https://github.com/apache/tinkerpop/pull/3078#discussion_r2066964588
##########
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(
Review Comment:
Suggest to wrap the call to `scheduleAtFixedRate` inside an if check for
`settings.ssl.refreshInterval <= 0` which would give the option of disabling
hot reloading (previous behaviour).
--
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]