Aliaxander
Aliaxander

Reputation: 2617

WSClient and SSL

In Play 2.4.3 web app I need to call other service via HTTPS using WSClient. I followed the article but the error appears:

play.api.libs.ws.ssl.CompositeCertificateException: No trust manager was able to validate this certificate chain: # of exceptions = 1

The exception inside CompositeCertificateException:

sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Part of application.conf responsible for SSL:

play.ws.ssl {
  trustManager = {
    stores = [
      { type : "PEM", path : "C:/A/B/globalsign.crt" }
    ]
  }
}

What's wrong here?

Upvotes: 0

Views: 1740

Answers (1)

Aliaxander
Aliaxander

Reputation: 2617

I solved the problem through the following steps:

  • Run InstallCert.java to generate jssecacerts file.
  • Add path to the file in application.conf.

Config example:

play.ws.ssl {
  trustManager = {
    stores = [
      {path: "C:/A/B/jssecacerts"}
      {path: ${java.home}/lib/security/cacerts}
    ]
  }
}

Upvotes: 2

Related Questions