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, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content