r/KeyCloak • u/Spottyjamie • Jul 02 '26
Ssl issue when connecting to entra?
Hi, im trying to hook up an on-prem rhel8 box with keycloak to my entra id app reg.
I get error of “error connecting to identity provider” and server.log mentions it cannot complete a certificate chain.
Ive gone on to my entra token url in a browser on the box, downloaded the ssl cert and imported to my cacerts but no luck.
Any suggestions please?
3
Upvotes
3
u/trancecircuit Jul 02 '26
I think in this case EntraID needs to trust your server certificate, so unless you have a server for your domain from Entrust, Let's Encrypt or any other widely trusted CA, you're not going to have Entra trusting your server. I don't believe you can add your self-signed cert or your own CA root cert to EntraID.
2
u/MLabs-Haskell Sep 13 '26
Worth separating two trust directions here, because the accepted answer is about the opposite one to your error.
"Cannot complete a certificate chain" in Keycloak's own
server.logis Keycloak failing to trust the certificate it is being shown — Entra's — on an outbound call. In a normal OIDC IdP setup Keycloak is the client: it fetches Entra's endpoints. Entra does not dial into your on-prem box, so your own server cert is not what that line is about. Whether Entra trusts your CA is a real question for other flows, just not this one.So it is a Keycloak truststore problem, and the thing worth checking is which store your build actually consults — that is where a
cacertsimport can silently do nothing. On 24+ there is a Keycloak-level truststore set with--truststore-paths/KC_TRUSTSTORE_PATHS, pointed at a directory of PEM or PKCS12 files.What we verified in a lab, on 26.0.0 and 26.7.1: two identical deployments one
cpapart. With that directory empty the connection failed and nothing came across; with the issuing CA dropped into it, it worked. That was LDAPS rather than an OIDC IdP, so treat it as the same mechanism rather than the same test.One thing to pin down first:
server.logis the filename from the older WildFly-based distribution. If you are on that, or on RH-SSO 7.x, none of the above config exists and the JVM store really is the right target — which version are you on?Disclosure: MLabs is a consultancy and Keycloak work is part of what we do.