-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SEC-1473 Allow no Truststore password #206
base: 5.5.x
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,6 +45,7 @@ | |
import org.junit.AfterClass; | ||
import org.junit.BeforeClass; | ||
import org.junit.Test; | ||
import org.junit.rules.TemporaryFolder; | ||
|
||
public class ApiHeadersTest { | ||
|
||
|
@@ -56,11 +57,16 @@ public class ApiHeadersTest { | |
private static String clientKeystoreLocation; | ||
private static TestApplication app; | ||
|
||
// Use a temporary folder so that .jks files created by this test are isolated | ||
// and deleted when the test is done | ||
public static TemporaryFolder tempFolder = new TemporaryFolder(); | ||
|
||
@BeforeClass | ||
public static void setUp() throws Exception { | ||
final File trustStore = File.createTempFile("ApiHeadersTest-truststore", ".jks"); | ||
final File clientKeystore = File.createTempFile("ApiHeadersTest-client-keystore", ".jks"); | ||
final File serverKeystore = File.createTempFile("ApiHeadersTest-server-keystore", ".jks"); | ||
tempFolder.create(); | ||
final File trustStore = File.createTempFile("ApiHeadersTest-truststore", ".jks", tempFolder.getRoot()); | ||
final File clientKeystore = File.createTempFile("ApiHeadersTest-client-keystore", ".jks", tempFolder.getRoot()); | ||
final File serverKeystore = File.createTempFile("ApiHeadersTest-server-keystore", ".jks", tempFolder.getRoot()); | ||
|
||
clientKeystoreLocation = clientKeystore.getAbsolutePath(); | ||
|
||
|
@@ -84,6 +90,7 @@ public static void teardown() throws Exception { | |
if (app != null) { | ||
app.stop(); | ||
} | ||
tempFolder.delete(); | ||
} | ||
|
||
@Test | ||
|
@@ -130,7 +137,7 @@ private static void createKeystoreWithCert(File file, String alias, Map<String, | |
final X509Certificate cert = new CertificateBuilder(30, "SHA1withRSA") | ||
.sanDnsName("localhost").generate("CN=mymachine.local, O=A client", keypair); | ||
|
||
TestSslUtils.createKeyStore(file.getPath(), new Password(SSL_PASSWORD), alias, | ||
TestSslUtils.createKeyStore(file.getPath(), new Password(SSL_PASSWORD), new Password(SSL_PASSWORD), alias, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This confuses me. It seems like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FYI, although this method has been stable, the previously called method now no longer exists, hence the compile failure. This just bit MDS as well. |
||
keypair.getPrivate(), cert); | ||
certs.put(alias, cert); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be the case if there was an exception thrown during
start()
and westop()
in afinally
block... as we do in the tests.