Skip to content

Commit a59b7e0

Browse files
authored
Use PEM files instead of a JKS for key material (#49625) (#49701)
So that the tests can also run in a FIPS 140 JVM, where using a JKS keystore is not allowed. Resolves: #49261
1 parent e6f530c commit a59b7e0

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ssl/SSLConfigurationReloaderTests.java

+7-4
Original file line numberDiff line numberDiff line change
@@ -509,16 +509,19 @@ void reloadSSLContext(SSLConfiguration configuration) {
509509
}
510510

511511
private Settings.Builder baseKeystoreSettings(Path tempDir, MockSecureSettings secureSettings) throws IOException {
512-
final Path keystorePath = tempDir.resolve("testclient.jks");
513-
Files.copy(getDataPath("/org/elasticsearch/xpack/security/transport/ssl/certs/simple/testnode.jks"), keystorePath);
512+
final Path keyPath = tempDir.resolve("testclient.pem");
513+
final Path certPath = tempDir.resolve("testclientcert.crt"); // testclient.crt filename already used in #testPEMTrustReloadException
514+
Files.copy(getDataPath("/org/elasticsearch/xpack/security/transport/ssl/certs/simple/testnode.pem"), keyPath);
515+
Files.copy(getDataPath("/org/elasticsearch/xpack/security/transport/ssl/certs/simple/testnode.crt"), certPath);
514516

515517
if (secureSettings == null) {
516518
secureSettings = new MockSecureSettings();
517519
}
518-
secureSettings.setString("xpack.security.transport.ssl.keystore.secure_password", "testnode");
520+
secureSettings.setString("xpack.security.transport.ssl.secure_key_passphrase", "testnode");
519521

520522
return Settings.builder()
521-
.put("xpack.security.transport.ssl.keystore.path", keystorePath.toString())
523+
.put("xpack.security.transport.ssl.key", keyPath.toString())
524+
.put("xpack.security.transport.ssl.certificate", certPath.toString())
522525
.setSecureSettings(secureSettings);
523526
}
524527

0 commit comments

Comments
 (0)