Replacing wildfly certificates keystore issue (ejbca ce docker container) #967
-
|
Hi, I am trying to use my own certificate for the server. It comes from a three tier hieararchy where I have added the cert, and the three CAs to a pkcs12 store. I get the certs as base64 encoded not binary, not sure if it matters when firstly adding them to the pkcs12 store. Then I tried several things: 1. mounted the store server.p12 as server.jks to /mnt/external/secrets/tls/ks and provided the password file server.storepasswd, here I get 2025-10-06 12:27:59,948+0000 INFO [/opt/keyfactor/bin/start.sh] (process:1) Importing keystore /opt/keyfactor/secrets/external/tls/ks/server.jks to /opt/keyfactor/tmp/tmp.LAUH5HjMf9/keystore.jks... so the log seems happy (I also successfuly import the truststore in /mnt/external/secrets/tls/ts with my CA chain) Though when I try to access the application I get ERR_CONNECTION_CLOSED so it seems wildfly does not let me through. (Works when I let it use the autogenerated management CA). But maybe there is an issue since i simply throw a PKCS12 container at it without any JKS conversion. 2. converted the server.p12 to jks using keytool and it seems fine, I can list the content given the password I am mounting to the container. Here I directly mount server.jks into /mnt/external/secrets/tls/ks but during startup I get 2025-10-06 12:34:58,465+0000 INFO [/opt/keyfactor/bin/start.sh] (process:1) No key password file were detected at '/opt/keyfactor/secrets/external/tls/ks/server.keypasswd'. Keystore password will also be used to access private key. I never set a specific key password during conversion it is simply: keytool -importkeystore -srckeystore server.p12 -srcstoretype PKCS12 -destkeystore server.jks -deststoretype JKS then simply answer the prompts on the new keystore password and source password. Needles to say the server does not like this configuration... Not sure where to move from here, thank you for any help. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 17 replies
-
|
You need to add you Root CA certificate to the truststore, which is a separate p12/jks file. Otherwise the TLS connection will not accept client certificates issued from that CA. The TLS connection announces something called "accepted client CAs" the the client as part of the TLS handshake. |
Beta Was this translation helpful? Give feedback.
At the moment wildfly is configured (in standalone.xml() in the container to use JKS keystores. It will migrate to p12 in a future release. At the moment, use JKS.