| 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)
Create a BCFKS Keystore (FIPS‑approved)
Use If you encounter a permissions-related error, grant write permissions to your working directory and rerun the above command:Verify the BCFKS keystore:
keytool from the Keycloak FIPS image to generate a BCFKS keystore and keypair (provider CCJ):Create BCFKS keystore
Generate a Local CA and Server Certificate (PEM)
To set up HTTPS using PEM files (instead of a keystore), follow the steps to create a local CA and sign a server certificate.
-
Generate a private key for the Certificate Authority (CA):
-
Create a root self-signed CA certificate:
-
Generate a Server RSA private key for Keycloak:
-
CSR for your Keycloak host (edit CN):
-
Create a file
keycloak.extcontaining certificate extension settings for a TLS certificate: - Sign a Certificate Signing Request (CSR) with your CA:
- Run
lsto verify that the following certificates were created:- CA:
myCA.crt,myCA.key,myCA.srl - Server (PEM):
keycloak.crt,keycloak.key,keycloak.csr,keycloak.ext
- CA:
Create a BCFKS Truststore (to trust your CA)
Import your CA into a BCFKS truststore:
Import CA into truststore
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:Visit the Keycloak console (UI) in HTTPS at https://localhost:8443.
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
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.