I am using Keycloak for service authentication to generate an access token.
However, I am getting javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
when Keycloak attempts to load URLs from https://example.com/auth/realms/services/.well-known/openid-configuration.
This is from a Spring boot application connecting to a Keycloak server installed in the OpenShift Container Platform.
Everything works well when I test from the locally installed Keycloak and I can actually get the properties from https://example.com/auth/realms/services/.well-known/openid-configuration when I run a GET request from a postman client and or browser.
My application.properties file has the below configs
keycloak.realm=services
keycloak.resource=ms-test-service
keycloak.auth-server-url=https://example.com/auth
keycloak.ssl-required=none
keycloak.use-resource-role-mappings=false
Can I override the connection to trust all certs or what's the work around?