I’ve been experiencing a very weird issue after restarting the Windows laptop I’ve been provided to work.
Before restarting, I was able to locally deploy a SpringBoot + GraphQL microservice using IntelliJIdea (pointing to a QA environment resource server using the properties: spring.security.oauth2.resourceserver.jwt.issuer-uri
and spring.security.oauth2.resourceserver.jwt.jwk-set-uri
) and I was able to test the endpoint and operations from Postman without any issue (after configuring the corresponding token and security parameters, of course).
However, after restarting my computer and trying to perform the request again, I am getting:
An error occurred while attempting to decode the Jwt:
Couldn't retrieve remote JWK set: org.springframework.web.client.ResourceAccessException: I/O error on GET request for "https://URL_TO_COGNITO/jwks.json":
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
I thought it was something related to Intellij, but I also tried doing the same from Spring Tool Suite and Eclipse and I am getting the same problem, so I suspect there should be something going on with Postman.
These are the properties that are set in the application-qa.properties file:
spring.security.oauth2.resourceserver.jwt.issuer-uri=https://URL_TO_COGNITO
spring.security.oauth2.resourceserver.jwt.jwk-set-uri=${spring.security.oauth2.resourceserver.jwt.issuer-uri}/.well-known/jwks.json
Just to add some details:
- Any piece of code was changed in the microservice
- Any configuration was changed in any IDE
- Any configuration was changed in Postman
- Java version used for compilation is Java 11.0.22
- Maven version 3.8.1
- Postman is able to send a request to any other external service or API, it just fails for this particular scenario.
- I have been working without issues for more than 1 year, but after restarting a couple of days ago, I started getting this error (the computer belongs to the company I work for, so I am not sure if some “security” or firewall configuration was installed after restarting that could be preventing postman from sending the request properly)