AppServer: fix keystore used to setup test SSL context factory

- configure dName
- add SANs ip:127.0.0.1, ip:[::1]

See jetty's own test setup in
1cd15e8d85/jetty-client/src/test/resources/readme_keystores.txt (L6)

and the fixes done in
1cd15e8d85

Change-Id: Ie3260db7a7090dfa92b43eb32bf247640ebf8482
This commit is contained in:
Matthias Sohn 2021-11-24 00:04:25 +01:00
parent 32b1a1b3a3
commit 791d3b0eb4
1 changed files with 5 additions and 2 deletions

View File

@ -180,7 +180,7 @@ private SslContextFactory.Server createTestSslContextFactory(
String hostName, String ip) {
SslContextFactory.Server factory = new SslContextFactory.Server();
String dName = "CN=,OU=,O=,ST=,L=,C=";
String dName = "CN=localhost,OU=JGit,O=Eclipse,ST=Ontario,L=Toronto,C=CA";
try {
File tmpDir = Files.createTempDirectory("jks").toFile();
@ -196,8 +196,11 @@ private SslContextFactory.Server createTestSslContextFactory(
"-keystore", keyStore.getAbsolutePath(), //
"-storepass", keyPassword,
"-alias", hostName, //
"-ext", "bc=ca:true", //
"-ext",
String.format("san=IP:%s,DNS:%s", ip, hostName), //
String.format(
"san=ip:%s,ip:127.0.0.1,ip:[::1],DNS:%s",
ip, hostName), //
"-genkeypair", //
"-keyalg", "RSA", //
"-keypass", keyPassword, //