I am currently facing an issue with SSL certificate validation in a Java application using Spring Cloud OpenFeign. I recently added new endpoints to my Feign client, and only these new endpoints are encountering SSL certificate issues, resulting in a SunCertPathBuilderException: unable to find valid certification path to requested target.
Environment:
Java 17
Spring Boot 3.1.8
Spring Cloud OpenFeign
How can I configure my Feign client to trust the SSL certificate of the new endpoints specifically? Is there a way to selectively trust these certificates without disabling SSL validation globally?
Any suggestions or guidance on this issue would be greatly appreciated!
The application works perfectly with existing endpoints, but any requests to the newly added endpoints fail due to SSL handshake failures. This error occurs only in our development environment, and not locally, suggesting an issue with how the SSL certificates are being handled or trusted.
@GetMapping(value = "/api/v1/internal/notes")
ResponseEntity<DeliveryNoteResponse> getNotesDetailListByNumber(
@RequestParam("number") String number, @RequestParam("type") String type,
@RequestParam(value = "status", required = false) String status);