|
9 | 9 |
|
10 | 10 | package org.elasticsearch.entitlement.initialization; |
11 | 11 |
|
| 12 | +import org.elasticsearch.core.Booleans; |
12 | 13 | import org.elasticsearch.core.PathUtils; |
13 | 14 | import org.elasticsearch.core.internal.provider.ProviderLocator; |
14 | 15 | import org.elasticsearch.entitlement.bootstrap.EntitlementBootstrap; |
|
49 | 50 | import java.nio.file.LinkOption; |
50 | 51 | import java.nio.file.OpenOption; |
51 | 52 | import java.nio.file.Path; |
| 53 | +import java.nio.file.Paths; |
52 | 54 | import java.nio.file.WatchEvent; |
53 | 55 | import java.nio.file.WatchService; |
54 | 56 | import java.nio.file.attribute.FileAttribute; |
@@ -242,10 +244,13 @@ private static PolicyManager createPolicyManager() { |
242 | 244 | ); |
243 | 245 |
|
244 | 246 | // 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 |
247 | 249 | 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 | + |
249 | 254 | Collections.addAll( |
250 | 255 | serverScopes, |
251 | 256 | new Scope( |
|
0 commit comments