title: How do I solve javax.net.ssl.SSLHandshakeException on Heroku?
body: <p>I faced <code>SSLHandshakeException</code> on Heroku.</p>
  
  <p>This app was not SSL app. But this app called a ssl-based web api from inside of the app.
  Usually, using keytool to adopt SSL cert to JVM solves this kind of problem.</p>
  
  <p>But how do I this on Heroku?</p>
  
  <p>logs here:</p>
  
  <pre><code>    2012-06-12T11:08:08+00:00 app[web.1]: Caused by: sun.security.validator.ValidatorException:  PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException:  unable to find valid certification path to requested target
      2012-06-12T11:08:08+00:00 app[web.1]:   at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:324) ~[na:1.6.0_20]
      2012-06-12T11:08:08+00:00 app[web.1]:   at sun.security.validator.Validator.validate(Validator.java:235) ~[na:1.6.0_20]
      2012-06-12T11:08:08+00:00 app[web.1]:   at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:147) ~[na:1.6.0_20]
      2012-06-12T11:08:08+00:00 app[web.1]:   at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:230) ~[na:1.6.0_20]
      2012-06-12T11:08:08+00:00 app[web.1]: Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
      2012-06-12T11:08:08+00:00 app[web.1]:   at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:270) ~[na:1.6.0_20]
      2012-06-12T11:08:08+00:00 app[web.1]:   at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:197) ~[na:1.6.0_20]
      2012-06-12T11:08:08+00:00 app[web.1]:   at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:255) ~[na:1.6.0_20]
      2012-06-12T11:08:08+00:00 app[web.1]:   at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:319) ~[na:1.6.0_20]
      2012-06-12T11:08:08+00:00 app[web.1]:   at sun.security.validator.Validator.validate(Validator.java:235) ~[na:1.6.0_20]
      2012-06-12T11:08:08+00:00 app[web.1]:   at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:147) ~[na:1.6.0_20]
      2012-06-12T11:08:08+00:00 app[web.1]:   at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:224) ~[na:1.6.0_20]
  </code></pre>