While creating a Credhub service instance and binding it to a Java application that uses Spring Credhub, Spring Credhub is unable to validate the certificate used on the Credhub server.
For example:
ERROR [nio-8080-exec-9] c.c.credhub.controller.DataController c.c.c.c.DataController.loadData(DataController.java:109) - GET|/v1/data|||||||||||||Error While Interpolating data {}: org.springframework.web.client.ResourceAccessException: I/O error on POST request for "https://credhub.service.cf.internal:8844/api/v1/interpolate": Received fatal alert: certificate_unknown; nested exception is javax.net.ssl.SSLHandshakeException: Received fatal alert: certificate_unknown at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:744) at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:670) at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:579) at org.springframework.credhub.core.interpolation.CredHubInterpolationTemplate.lambda$interpolateServiceData$0(CredHubInterpolationTemplate.java:52)
You may also see this error if
mTLS
fails and Spring Credhub tries to fallback to using
OAuth2
:
org.springframework.credhub.core.CredHubException: Error calling CredHub: 401: {"error":"invalid_token","error_description":"Full authentication is required to access this resource"}