You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2019/08/28 18:55:32 UTC
[GitHub] [bookkeeper] rdhabalia commented on a change in pull request #2154:
[bookie] auto refresh tls cert at bookie-server
rdhabalia commented on a change in pull request #2154: [bookie] auto refresh tls cert at bookie-server
URL: https://github.com/apache/bookkeeper/pull/2154#discussion_r318741155
##########
File path: bookkeeper-server/src/main/java/org/apache/bookkeeper/tls/TLSContextFactory.java
##########
@@ -262,7 +269,36 @@ private void createClientContext(AbstractConfiguration conf)
sslContext = sslContextBuilder.build();
}
- private void createServerContext(AbstractConfiguration conf) throws SecurityException, KeyStoreException,
+ private void createServerContext()
+ throws SecurityException, KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException,
+ UnrecoverableKeyException, InvalidKeySpecException, IllegalArgumentException {
+ isServerCtx = true;
+ ServerConfiguration serverConf = (ServerConfiguration) config;
+ tTLSCertificatePath = new FileModifiedTimeUpdater(serverConf.getTLSCertificatePath());
+ tLSKeyStoreFilePath = new FileModifiedTimeUpdater(serverConf.getTLSKeyStore());
+ tLSKeyStorePasswordFilePath = new FileModifiedTimeUpdater(serverConf.getTLSKeyStorePasswordPath());
+ tLSTrustStoreFilePath = new FileModifiedTimeUpdater(serverConf.getTLSTrustStore());
+ tLSTrustStorePasswordFilePath = new FileModifiedTimeUpdater(serverConf.getTLSTrustStorePasswordPath());
+ updateServerContext();
+ }
+
+ private SslContext getSSLContext() {
Review comment:
`certRefreshTime` gets initialized only once at `init` method. and `certLastRefreshTime` is a volatile which gets updated only in `updateServerContext()` which is `synchronized` and thread-safe. So, it seems we don't have to make `getSSLContext()` synchronized. right?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services