From 009e764c103babd4f4c28e6548cfb250fdbffe02 Mon Sep 17 00:00:00 2001 From: Ry Biesemeyer Date: Wed, 6 Feb 2019 19:55:47 +0000 Subject: [PATCH] keystore: instances of `CharsetEncoder` are stateful and cannot be shared Fixes a crash that occurs on pipeline load and/or reload when using both the java keystore and the multi-pipeline feature, when more than one pipeline references `${}`-style variables. Fixes #10408 --- .../java/org/logstash/secret/store/backend/JavaKeyStore.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/logstash-core/src/main/java/org/logstash/secret/store/backend/JavaKeyStore.java b/logstash-core/src/main/java/org/logstash/secret/store/backend/JavaKeyStore.java index 90c64c165..b0424ff58 100644 --- a/logstash-core/src/main/java/org/logstash/secret/store/backend/JavaKeyStore.java +++ b/logstash-core/src/main/java/org/logstash/secret/store/backend/JavaKeyStore.java @@ -41,7 +41,7 @@ public final class JavaKeyStore implements SecretStore { private static final String KEYSTORE_TYPE = "pkcs12"; private static final Logger LOGGER = LogManager.getLogger(JavaKeyStore.class); private static final String PATH_KEY = "keystore.file"; - private static final CharsetEncoder asciiEncoder = StandardCharsets.US_ASCII.newEncoder(); + private final CharsetEncoder asciiEncoder = StandardCharsets.US_ASCII.newEncoder(); private KeyStore keyStore; private char[] keyStorePass; private Path keyStorePath;