1

I am having an xml which will connect to tfs through https connection to get latest files from it. I am trying to run this as ant task invoked from my java scheduler. When i try to invoke it I am getting the following error message :

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

But if i invoke the ant task from a bat file directly, it is working fine without any issues.

Kindly help me out on how to handle the execption when invoking from java

Manoj K J
  • 57
  • 3
  • The HTTPS address you are accessing uses has a self-signed SSL cert. Pretty common problem. See http://stackoverflow.com/questions/2893819/telling-java-to-accept-self-signed-ssl-certificate – Mark O'Connor Dec 10 '13 at 22:22

1 Answers1

0

These steps, based on Oracle instructions, worked for me:

  • Get InstallCert.java (the link in Oracle's instructions is broken)
  • Compile and execute java InstallCert [host]:[port]
    • enter '1'
  • Copy and rename the newly created jssecacerts file as %JAVA_HOME%\jre\lib\security\cacerts (backup the original, just in case)
  • Rerun Ant, it should not complain about certificate anymore

There may be other solutions as well.

Community
  • 1
  • 1
Juuso Ohtonen
  • 6,643
  • 7
  • 54
  • 89