Configuring Spring RestTemplate to use SSL

Solution Unverified - Updated -

Issue

  • Getting the following error when making a REST call using Spring RestTemplate to a SSL protected URL:

    javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: 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:438)
    

Environment

  • Spring RestTemplate

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.