Invalid Certificate - PKIX Path - RestTemplate #14251
Labels
in: oauth2
An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose)
status: declined
A suggestion or change that we don't feel we should currently apply
type: enhancement
A general enhancement
Describe the bug
Caused by: org.springframework.web.client.ResourceAccessException: I/O error on GET request for "https://.../.well-known/openid-configuration": PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at org.springframework.web.client.RestTemplate.createResourceAccessException(RestTemplate.java:888)
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:868)
at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:714)
at org.springframework.security.oauth2.client.registration.ClientRegistrations.lambda$oidc$0(ClientRegistrations.java:163)
at org.springframework.security.oauth2.client.registration.ClientRegistrations.getBuilder(ClientRegistrations.java:216)
... 58 common frames omitted
To Reproduce
Don't have the SSL certificate in the cacerts and use Spring boot security - oauth2 client 6.1.5
Expected behavior
Either it should depend on the RestTemplate bean or should accept the certificate.
Sample
Used SSL configuration as well
spring:
ssl:
bundle:
pem:
client:
truststore:
certificate: "classpath:config/tls/certs.crt"
server:
ssl:
bundle: "client"
http2:
enabled: true
Reports that include a sample will take priority over reports that do not.
At times, we may require a sample, so it is good to try and include a sample up front.
The text was updated successfully, but these errors were encountered: