| File | Purpose |
|---|---|
server.keystore (BCFKS) | FIPS-approved keystore (private key + cert) |
truststore.bcfks | FIPS-approved truststore (contains CA certs) |
myCA.crt / myCA.key | Local CA (root) for signing/trusting dev certs |
keycloak.crt / keycloak.key | Server certificate & key (PEM) for Keycloak |
- Docker available locally
- Token to pull images from the Minimus image registry
- A working directory for keystores and certs
Deploy Keycloak for production in HTTPS mode (or in HTTP dev mode)
1
Create a BCFKS Keystore (FIPS‑approved)
Use Verify the BCFKS keystore:
keytool from the Keycloak FIPS image to generate a BCFKS keystore and keypair (provider CCJ):Docker run command to create keystore
Verify the keystore
2
Generate a Local CA and a Server Certificate (PEM)
To set up HTTPS using PEM files (instead of a keystore), create a local CA and sign a server cert:Run
ls to verify that the following certificates were created:- CA:
myCA.crt,myCA.key,myCA.srl - Server (PEM):
keycloak.crt,keycloak.key,keycloak.csr,keycloak.ext
3
Create a BCFKS Truststore (to trust your CA)
Import your CA into a BCFKS truststore:
4
Run Keycloak
To run in dev mode, deploy Keycloak in HTTP:Visit the Keycloak console (UI) at http://localhost:8080.To run in production, deploy Keycloak with the truststore in HTTPS:
Run Keycloak in HTTP
Even in HTTP mode, FIPS checks still apply to admin and other passwords so ensure they have at least 14 characters.
Run Keycloak in HTTPS
5
Trust the CA locally (browser/curl)
6
File hygiene
Change the file permissions in
server.keystoreso only the file owner can read/write to it, and nobody else can access it:Troubleshooting
If you get an errorpassword must be at least 112 bits, it means that one or more passwords is under 14 characters long. Passwords should be 16-24 characters.
Check the passwords for the following variables: KC_BOOTSTRAP_ADMIN_PASSWORD, KC_HTTPS_KEY_STORE_PASSWORD, truststore password, etc.