I have installed dcm4chee-arc-psql:5.31.2-secure with keycloak:23.0.3 dockers followed by this instruction:
as hostname, as this is a test environment.
Everything installed fine and I can login to dcm4chee-arc/ui2 using Keycloak, however I need to change the default certificates to my own (self-signed, with additional Subject Alternative Names).
DCM4CHEE has mapped key.p12 and cacerts.p12 in local directory /var/local/dcm4chee-arc/wildfly/configuration/keystores/
Keycloak has key.p12 and cacerts.p12 inside docker in directory /opt/keycloak/conf/keystores/
I have used the following keytool commands:
1. Created a self-signed certificate for Keycloak:
keytool -genkeypair -alias keycloak -keyalg RSA -keysize 2048 -validity 3650 -keystore /home/user/testcerts/keycloak/keycloak_key.p12 -storetype PKCS12 -dname "CN=127.0.0.1, OU=KeycloakSelfSigned, O=Unknown, L=Unknown, ST=Unknown, C=Unknown" -ext "SAN=IP:127.0.0.1,IP:192.168.56.121,DNS:localhost,DNS:keycloak" -storepass secret2. Exported Keycloak's certificate and added certificate with the private key to Keycloak's key.p12 file:
keytool -export -alias keycloak -keystore /home/user/testcerts/keycloak/keycloak_key.p12 -file /home/user/testcerts/keycloak/keycloak_cert.crt
keytool -importkeystore -srckeystore /home/user/testcerts/keycloak/keycloak_key.p12 -destkeystore /home/user/testcerts/keycloak/keycloak_key.p12 -deststoretype PKCS12 -deststorepass secret3. Added Keycloak's certificate to dcm4che's cacerts.p12 file:
keytool -import -alias keycloak -file /home/user/testcerts/keycloak/keycloak_cert.crt -keystore /home/user/testcerts/dcm4che/dcm4che_cacerts.p12 -storetype PKCS12 -storepass secret4. Created a self-signed certificate for dcm4che:
keytool -genkeypair -alias dcm4che -keyalg RSA -keysize 2048 -validity 3650 -keystore /home/user/testcerts/dcm4che/dcm4che_key.p12 -storetype PKCS12 -dname "CN=127.0.0.1, OU=dcm4cheSelfSigned, O=Unknown, L=Unknown, ST=Unknown, C=Unknown" -ext "SAN=IP:127.0.0.1,IP:192.168.56.121,DNS:localhost,DNS:keycloak,DNS:arc" -storepass secret5. Exported dcm4che's certificate and added certificate with the private key to dcm4che's key.p12 file:
keytool -export -alias dcm4che -keystore /home/user/testcerts/dcm4che/dcm4che_key.p12 -file /home/user/testcerts/dcm4che/dcm4che_cert.crt
keytool -importkeystore -srckeystore /home/user/testcerts/dcm4che/dcm4che_key.p12 -destkeystore /home/user/testcerts/dcm4che/dcm4che_key.p12 -deststoretype PKCS12 -deststorepass secret6. Added dcm4che's certificate to Keycloak's cacerts.p12 file:
keytool -import -alias dcm4che -file /home/user/testcerts/dcm4che/dcm4che_cert.crt -keystore /home/user/testcerts/keycloak/keycloak_cacerts.p12 -storetype PKCS12 -storepass secret7. I have renamed and replaced the key.p12 and cacerts.p12 for both Keycloak and DCM4CHEE with my own generated files, and restarted all docker containers.
After this change I can successfully login to
https://localhost:8843/admin/dcm4che/console/ (it shows
KeycloakSelfSigned certificate)
But I cannot access
https://localhost:8443/dcm4chee-arc/ui2/ (it shows
dcm4cheSelfSigned certificate), I am getting white page with text
Forbidden.
And in DCM4CHEE logs I see this line:
2024-01-30 17:23:10,335 WARN [org.wildfly.security.http.oidc] (default task-1) ELY23005: Unable to load OpenID provider metadata from https://keycloak:8843/realms/dcm4che/.well-known/openid-configuration
How should I created a self signed certificate for DCM4CHEE and Keycloak so that DCM4CHEE would work it with?
Do I need to redeploy some docker containers with some other environment variable values if I use my own self-signed certificates?
I am missing what I did wrong and why dcm4chee-arc/ui2 gives me Forbidden.
Thanks,
M.