I have X509 Authentication working properly using Keycloak and SAML. When I enable OCSP and point it to our OCSP Server, I get the following error and I can no longer login.
2019-12-20 09:39:29,033 ERROR [org.keycloak.services] (default task-16) No trusted CA in certificate found: CN=DOD ID CA-49, OU=PKI, OU=DoD, O=U.S. Government, C=US. Add it to truststore SPI if valid.: java.security.GeneralSecurityException: No trusted CA in certificate found: CN=DOD ID CA-49, OU=PKI, OU=DoD, O=U.S. Government, C=US. Add it to truststore SPI if valid.
In the standalone.xml file I have added the following.
<spi name="truststore">
<provider name="file" enabled="true">
<properties>
<property name="file" value="/usr/java/latest/jre/lib/security/cacerts"/>
<property name="password" value="changeit"/>
<property name="hostname-verification-policy" value="WILDCARD"/>
<property name="disabled" value="false"/>
</properties>
</provider>
</spi>
When I run the keytool command like this it shows that DOD ID CA-49 and DOD ROOT CA 3 exist.
keytool -list -keystore /usr/java/latest/jre/lib/security/cacerts
dod_id-ca-49, Dec 13, 2019, trustedCertEntry,
Certificate fingerprint (SHA1): 6C:D6:E8:BD:7A:CD:2F:08:E2:16:93:98:8A:30:9E:CA:67:72:C1:34
dod_root_ca_3, Dec 11, 2019, trustedCertEntry,
Certificate fingerprint (SHA1): D7:3C:A9:11:02:A2:20:4A:36:45:9E:D3:22:13:B4:67:D7:CE:97:FB
I cannot figure out how to get keycloak to find the CA certs that I added. There is also these settings in the standalone.xml
<security-realm name="ApplicationRealm">
<server-identities>
<ssl>
<keystore path="server.keystore" relative-to="jboss.server.config.dir" keystore-password="changeit" alias="server" key-password="changeit"/>
</ssl>
</server-identities>
<authentication>
<truststore path="cacerts" relative-to="jboss.server.config.dir" keystore-password="changeit" />
<local default-user="$local"/>
<properties path="mgmt-users.properties" relative-to="jboss.server.config.dir"/>
</authentication>
<authorization>
<properties path="application-roles.properties" relative-to="jboss.server.config.dir"/>
</authorization>
</security-realm>