-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #4481 - Fix NeedWantClientAuthTest for OpenJDK 13.0.2/11.0.6.
Updated the keystores to PKCS12 and added the Basic Constraint CA:true to the server certificate. Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
- Loading branch information
Showing
14 changed files
with
40 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,7 +42,7 @@ public class SslConnectionTest | |
@Test | ||
public void testSslConnectionClosedBeforeFill() throws Exception | ||
{ | ||
File keyStore = MavenTestingUtils.getTestResourceFile("keystore.jks"); | ||
File keyStore = MavenTestingUtils.getTestResourceFile("keystore.p12"); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
sbordet
Author
Contributor
|
||
SslContextFactory sslContextFactory = new SslContextFactory.Server(); | ||
sslContextFactory.setKeyStorePath(keyStore.getAbsolutePath()); | ||
sslContextFactory.setKeyStorePassword("storepwd"); | ||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Since OpenJDK 13.0.2/11.0.6 it is required that CA certificates have the extension CA=true. | ||
|
||
The keystores are generated in the following way: | ||
|
||
# Generates the server keystore. Note the BasicConstraint=CA:true extension. | ||
$ keytool -v -genkeypair -validity 36500 -keyalg RSA -keysize 2048 -keystore keystore.p12 -storetype pkcs12 -dname "CN=server, OU=Jetty, O=Webtide, L=Omaha, S=NE, C=US" -ext BC=CA:true | ||
|
||
# Export the server certificate. | ||
$ keytool -v -export -keystore keystore.p12 -rfc -file server.crt | ||
|
||
# Export the server private key. | ||
$ openssl pkcs12 -in keystore.p12 -nodes -nocerts -out server.key | ||
|
||
# Generate the client keystore. | ||
$ keytool -v -genkeypair -validity 36500 -keyalg RSA -keysize 2048 -keystore client_keystore.p12 -storetype pkcs12 -dname "CN=client, OU=Jetty, O=Webtide, L=Omaha, S=NE, C=US" | ||
|
||
# Generate the Certificate Signing Request. | ||
$ keytool -certreq -file client.csr -keystore client_keystore.p12 | ||
|
||
# Sign the CSR. | ||
$ openssl x509 -req -days 36500 -in client.csr -CA server.crt -CAkey server.key -CAcreateserial -sha256 -out signed.crt | ||
|
||
# Import the server certificate into the client keystore. | ||
$ keytool -v -import -alias ca -file server.crt -keystore client_keystore.p12 | ||
|
||
# Import the signed CSR. | ||
$ keytool -import -file signed.crt -keystore client_keystore.p12 |
Wouldn't this change also require setting the KeyStoreType?