0

I have a REST call for GCP for fetching the regions. After upgrade of Java version from 8.252 to 8.352, the API is started failing with exception.

org.springframework.web.client.ResourceAccessException: I/O error on GET request for "https://compute.googleapis.com/compute/v1/projects/my-project/regions": PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target; nested exception is javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:785) ~[spring-web-5.3.22.jar:5.3.22]
    at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:732) ~[spring-web-5.3.22.jar:5.3.22]
    at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:641) ~[spring-web-5.3.22.jar:5.3.22]

...................
...................
...................
Caused by: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    at sun.security.ssl.Alert.createSSLException(Alert.java:131) ~[?:1.8.0_352]
    at sun.security.ssl.TransportContext.fatal(TransportContext.java:324) ~[?:1.8.0_352]
    at sun.security.ssl.TransportContext.fatal(TransportContext.java:267) ~[?:1.8.0_352]
    at sun.security.ssl.TransportContext.fatal(TransportContext.java:262) ~[?:1.8.0_352]

After reverting to older version it's working, but not with 8.352.

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197

0 Answers0