Merge pull request elastic/elasticsearch#1701 from s1monw/fix_trust_store_loading
Watcher should try to load trust/keystore from `config` directory Today Watcher tries to load stuff from the bin's parent directory which is not readable since the shared data directory has been moved out of the nodes parent in elasticsearchelastic/elasticsearch#17072 which causes security exception now. The test copies trust stores into the config dir and that's where we should read it from by default or even better explicitly configure the path?! Original commit: elastic/x-pack-elasticsearch@6ad580d1ea
This commit is contained in:
commit
c7129e52ec
|
@ -67,7 +67,9 @@ public class CleanerService extends AbstractLifecycleComponent<CleanerService> {
|
||||||
@Override
|
@Override
|
||||||
protected void doClose() {
|
protected void doClose() {
|
||||||
logger.debug("closing cleaning service");
|
logger.debug("closing cleaning service");
|
||||||
|
if (runnable != null) {
|
||||||
runnable.cancel();
|
runnable.cancel();
|
||||||
|
}
|
||||||
logger.debug("cleaning service closed");
|
logger.debug("cleaning service closed");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -281,7 +281,7 @@ public class HttpClient extends AbstractLifecycleComponent<HttpClient> {
|
||||||
if (keyStore == null) {
|
if (keyStore == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
Path path = env.binFile().getParent().resolve(keyStore);
|
Path path = env.configFile().resolve(keyStore);
|
||||||
if (Files.notExists(path)) {
|
if (Files.notExists(path)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -304,7 +304,7 @@ public class HttpClient extends AbstractLifecycleComponent<HttpClient> {
|
||||||
// Load TrustStore
|
// Load TrustStore
|
||||||
KeyStore ks = null;
|
KeyStore ks = null;
|
||||||
if (trustStore != null) {
|
if (trustStore != null) {
|
||||||
Path trustStorePath = env.binFile().getParent().resolve(trustStore);
|
Path trustStorePath = env.configFile().resolve(trustStore);
|
||||||
if (Files.exists(trustStorePath)) {
|
if (Files.exists(trustStorePath)) {
|
||||||
ks = readKeystore(trustStorePath, trustStorePassword);
|
ks = readKeystore(trustStorePath, trustStorePassword);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue