Pages

Tuesday, 22 October 2019

[SOLVED] PKIX path validation failed: java.security.cert.CertPathValidatorException: Path does not chain with any of the trust anchors

PROBLEM
PKIX path validation failed: java.security.cert.CertPathValidatorException: Path does not chain with any of the trust anchors
CAUSE 
does not recognize the digital certificate  issuer or path validatioan failed
My CODE 
  PKIXParameters params = new PKIXParameters(Collections.singleton(anchor));
  params.setRevocationEnabled(true);
SOLVED

  • Change the digital certificate issuer/certificate authority to JKS format
  • Change the source code to
 KeyStore keystore = KeyStore.getInstance("JKS");
            try (InputStream is = Files.newInputStream(Paths.get("root.jks"))) {
                keystore.load(is, "".toCharArray());
            }

            PKIXParameters params = new PKIXParameters(keystore);
            params.setRevocationEnabled(true);


No comments:

Post a Comment