Skip to content

Commit 585be1e

Browse files
committed
use jdk lib dir rather than es libs
1 parent 9501d77 commit 585be1e

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

libs/entitlement/src/main/java/org/elasticsearch/entitlement/initialization/EntitlementInitialization.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
package org.elasticsearch.entitlement.initialization;
1111

12+
import org.elasticsearch.core.Booleans;
1213
import org.elasticsearch.core.PathUtils;
1314
import org.elasticsearch.core.internal.provider.ProviderLocator;
1415
import org.elasticsearch.entitlement.bootstrap.EntitlementBootstrap;
@@ -49,6 +50,7 @@
4950
import java.nio.file.LinkOption;
5051
import java.nio.file.OpenOption;
5152
import java.nio.file.Path;
53+
import java.nio.file.Paths;
5254
import java.nio.file.WatchEvent;
5355
import java.nio.file.WatchService;
5456
import java.nio.file.attribute.FileAttribute;
@@ -242,10 +244,13 @@ private static PolicyManager createPolicyManager() {
242244
);
243245

244246
// conditionally add FIPS entitlements if FIPS only functionality is enforced
245-
if ("true".equals(System.getProperty("org.bouncycastle.fips.approved_only"))) {
246-
// if custom trust store is set, grant read access to its location, otherwise use the default trust store
247+
if (Booleans.parseBoolean(System.getProperty("org.bouncycastle.fips.approved_only"), false)) {
248+
// if custom trust store is set, grant read access to its location, otherwise use the default JDK trust store
247249
String trustStore = System.getProperty("javax.net.ssl.trustStore");
248-
Path trustStorePath = trustStore != null ? Path.of(trustStore) : bootstrapArgs.libDir().resolve("security/jssecacerts");
250+
Path trustStorePath = trustStore != null
251+
? Path.of(trustStore)
252+
: Paths.get(System.getProperty("java.home")).resolve("lib/security/jssecacerts");
253+
249254
Collections.addAll(
250255
serverScopes,
251256
new Scope(

0 commit comments

Comments
 (0)