Problem
The issue faced is in the TestNG runner in IntelliJ, where it generates a temporary TestNG XML file that references the TestNG.org. If the XML validation fails due to a custom certificate authority, there's an exception notified - "org.testng.TestNGException: sun.security.provider.certpath.SunCertPathBuilderException: unable to find a valid certification path to requested target".
The question arises on whether a configuration within the TestNG runner in IntelliJ could be provided to ignore the HTTPS validation on the TestNG.org. By doing so, it might also help companies who have XML validation failures due to custom certificate authority.
Resolution
According to https://github.com/testng-team/testng/issues/2348#issuecomment-667114396
I am guessing that you are doing this on your office laptop/desktop which is behind a corporate proxy. What is happening here is that, Java is basically complaining that when it tried hitting https://testng.org the server returned a bunch of certificates (usually the proxy server also appends its self signed certificate in the chain) of which one or more of them were not to be found in the
JAVA_HOME\jre\lib\security\cacerts.There are two ways of getting past this problem.
- You download your proxy server's certificate (called as trusted root certificate) (refer here for some help on this) and add it to your
cacerts- Run TestNG using the JVM argument
-Dtestng.dtd.http=trueThere's nothing wrong with TestNG as such. Closing this issue.
In IDEA, you may run TestNG using the JVM argument -Dtestng.dtd.http=true :
Related issues:
Can you make the TestNG runner ignore https://testng.org validation? org.testng.TestNGException: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Comments
0 comments
Please sign in to leave a comment.