I'm connected to a corporate network and getting this error when trying to deploy to salesforce using Ant.

Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
        at sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:141)
        at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:126)
        at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:280)
        at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:382)

There isn't a proxy server in my internet options and I'm able to use Dataloader while connected to this same network. Why could this be happening?

Update I'm using Ant 1.10.1 with jdk 1.8.0_131 and salesforce-ant-39 or salesforce-ant-40

Update I feel like this should work https://stackoverflow.com/questions/21076179/pkix-path-building-failed-and-unable-to-find-valid-certification-path-to-requ#36427118

I downloaded the certificate using chrome from https://test.salesforce.com. Then I imported it to cacerts keystore. My java application will work maybe 10% of the time but every other time I get the exception.

  • This is from Salesforce-ANT.jar download it again and try to make sure JDK version and ant version matches. – Avijit Chakraborty Jun 20 '17 at 0:27
  • @gary69 - were you able to come out of this issue? I also got stuck with same issue salesforce.stackexchange.com/questions/193589/… – rajasekhar Sep 26 '17 at 17:20
  • still facing it when trying to use salesforce api from a java application – gary69 Sep 27 '17 at 21:49

The problem was that a Cloud Access Security Broker, NetSkope, was installed on my work laptop through a software update. This was altering the certificate chain. When I disabled this it worked.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.