diff --git a/src/main/java/org/cloudfoundry/security/FileWatchingX509ExtendedKeyManager.java b/src/main/java/org/cloudfoundry/security/FileWatchingX509ExtendedKeyManager.java index b931975..9fba576 100644 --- a/src/main/java/org/cloudfoundry/security/FileWatchingX509ExtendedKeyManager.java +++ b/src/main/java/org/cloudfoundry/security/FileWatchingX509ExtendedKeyManager.java @@ -55,7 +55,8 @@ final class FileWatchingX509ExtendedKeyManager extends X509ExtendedKeyManager { this.keyManagerFactory = keyManagerFactory; new FileWatcher(this.certificates, new FileWatcherCallback()).watch(); - new FileWatcher(this.privateKey, new FileWatcherCallback()).watch(); + // disable watching the key file to prevent race condition bug - a certificate file change covers the key change + // new FileWatcher(this.privateKey, new FileWatcherCallback()).watch(); if (this.keyManager.compareAndSet(null, getKeyManager(getKeyStore()))) { this.logger.info(String.format("Initialized KeyManager for %s and %s", this.privateKey, this.certificates));