Repository navigation
[#487] Add ssl-gen module to generate SSL certificates at build time - #501
Conversation
|
@darranl Do you mind reviewing the I still had to import and use BouncyCastle to export the private keys that were needed by @hpehl To verify the examples, I also simplified their use and did parts of #490 (at least the |
|
Writing the PEM files is something we could plan for the future so makes sense to use BC for now, we have reading support so adding writing support makes sense. |
|
@hpehl I think this is ready for review. Before it is merged, I'll squash all the commits if that's ok with you? |
|
LGTM! Thanks @jmesnil |
…at build time Replace the static ssl/ directory (which contained expired certificates last generated in January 2023 with weak 1024-bit client keys) with a new ssl-gen Maven module that generates fresh PKCS12 keystores and truststores on every build using keytool-maven-plugin. All consumers (testsuite, examples service and client modules) now copy the required files directly from ssl-gen/target/generated-ssl/ at build time instead of referencing hard-coded static files. Key changes: - Add ssl-gen/ module: generates server.keystore.p12, server.truststore.p12, client.keystore.p12, client.truststore.p12, client.truststore.pem plus CLI scripts using keytool-maven-plugin (2048-bit RSA, 365-day validity) - Remove all static SSL binary files (expired certs, weak keys) - Move configure-elytron-*.cli scripts to ssl-gen/src/main/resources/ and update them to use PKCS12 format - Testsuite: copy server keystores to WildFly config dir at process-test-resources; fix test code to use relative-to=jboss.server.config.dir instead of fragile relative path hacks; update two-way TLS code to load PKCS12 via KeyManagerFactory instead of PEM private key streams - Examples service: replace maven-antrun copy with maven-resources-plugin; update CLI script paths to reference ssl-gen output - Examples client: copy SSL files from ssl-gen output to target/classes; update two-way TLS code for PKCS12 KeyManagerFactory - Use Bouncy Castle JcaPEMWriter to export the client certificate and private key from the PKCS12 keystore as client.crt.pem and client.key.pem. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Replace the static ssl/ directory (which contained expired certificates
last generated in January 2023 with weak 1024-bit client keys) with a
new ssl-gen Maven module that generates fresh PKCS12 keystores and
truststores on every build using keytool-maven-plugin.
All consumers (testsuite, examples service and client modules) now copy
the required files directly from ssl-gen/target/generated-ssl/ at build
time instead of referencing hard-coded static files.
Key changes:
client.keystore.p12, client.truststore.p12, client.truststore.pem plus
CLI scripts using keytool-maven-plugin (2048-bit RSA, 365-day validity)
and update them to use PKCS12 format
process-test-resources; fix test code to use relative-to=jboss.server.config.dir
instead of fragile relative path hacks; update two-way TLS code to
load PKCS12 via KeyManagerFactory instead of PEM private key streams
update CLI script paths to reference ssl-gen output
update two-way TLS code for PKCS12 KeyManagerFactory