Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask question.(5)

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

ITtutoria

ITtutoria Logo ITtutoria Logo

ITtutoria Navigation

  • Python
  • Java
  • Reactjs
  • JavaScript
  • R
  • PySpark
  • MYSQL
  • Pandas
  • QA
  • C++
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Python
  • Science
  • Java
  • JavaScript
  • Reactjs
  • Nodejs
  • Tools
  • QA
Home/ Questions/Quick solution to fix the error: java security cert certpathvalidatorexception certificate chaining error
Next
Answered
Jael Gelbero
  • 16
Jael Gelbero
Asked: May 18, 20222022-05-18T19:32:24+00:00 2022-05-18T19:32:24+00:00In: Programs

Quick solution to fix the error: java security cert certpathvalidatorexception certificate chaining error

  • 16

. Advertisement .

..3..

. Advertisement .

..4..

For the problem “java security cert certpathvalidatorexception certificate chaining error.” I tried to fix it, but It doesn’t work and returns the result I want. Here is my program:

Security.setProperty("ssl.SocketFactory.provider", "com.ibm.jsse2.SSLSocketFactoryImpl");
  Security.setProperty("ssl.ServerSocketFactory.provider", "com.ibm.jsse2.SSLServerSocketFactoryImpl");
  Security.setProperty("javax.net.ssl.trustStore", "cacerts.jks");
  Security.setProperty("javax.net.ssl.keyStore", "keystore.jks");
  Security.setProperty("javax.net.ssl.keyStoreType", "pkcs12");
  Security.setProperty("javax.net.ssl.trustStoreType", "JKS");

and

java.security.cert.CertPathValidatorException: Certificate chaining error
 javax.net.ssl.SSLHandshakeException: com.ibm.jsse2.util.h: PKIX path building failed: java.security.cert.CertPathBuilderException: PKIXCertPathBuilderImpl could not build a valid CertPath.; internal cause is:
  java.security.cert.CertPathValidatorException: The certificate issued by CN=Walmart Root CA, O=Wal-Mart Stores Inc is not trusted; internal cause is:
  java.security.cert.CertPathValidatorException: Certificate chaining error
  at com.ibm.jsse2.o.a(o.java:22)
  at com.ibm.jsse2.SSLSocketImpl.a(SSLSocketImpl.java:423)
  at com.ibm.jsse2.kb.a(kb.java:192)
  at com.ibm.jsse2.kb.a(kb.java:176)
  at com.ibm.jsse2.lb.a(lb.java:53)
  at com.ibm.jsse2.lb.a(lb.java:464)
  at com.ibm.jsse2.kb.s(kb.java:545)
  at com.ibm.jsse2.kb.a(kb.java:530)
  at com.ibm.jsse2.SSLSocketImpl.a(SSLSocketImpl.java:79)
  at com.ibm.jsse2.SSLSocketImpl.h(SSLSocketImpl.java:437)
  at com.ibm.jsse2.SSLSocketImpl.a(SSLSocketImpl.java:142)
  at com.ibm.jsse2.SSLSocketImpl.startHandshake(SSLSocketImpl.java:686)
  at com.ibm.net.ssl.www2.protocol.https.c.afterConnect(c.java:98)
  at com.ibm.net.ssl.www2.protocol.https.d.connect(d.java:13)
  at com.ibm.net.ssl.www2.protocol.https.b.connect(b.java:6)
  at com.dwl.tcrm.tester.RESTClient_2.main(RESTClient_2.java:76)

has occurred. I’ve checked the entire command line but still can’t find the mistake.

websphere-7
  • 2 2 Answers
  • 181 Views
  • 0 Followers
  • 0
Answer
Share
  • Facebook
  • Report

2 Answers

  • Voted
  • Oldest
  • Recent
  • Random
  1. Best Answer
    dttutoria Expert
    2022-06-23T16:46:13+00:00Added an answer on June 23, 2022 at 4:46 pm

    The cause: The error message “java security cert certpathvalidatorexception certificate chaining error” indicates that cacerts have not added your certificate.

    Solution: Attempt to run this command as keytool -list -v -keystore your path to cacerts and compare the serial number of your certificate to the output. Please adhere to the instructions below if it is not there.

    The Intermediate certificate may be exported by:

    Internet Explorer then click Tools then click Internet Options then click Content then click Certificates then click To view the Certificate Path: Select Certificate then click View then click Certification Path then click To Export the Certificate: Select Certificate then click Export then click DER

    encoded Binary Format then click Save ( From Firefox then click Tools then click Options then click Advanced then click Encryption then click View Certificates ) after this add this exported certificate with below command

    “keytool -import -trustcacerts -Keystore CACERTS(path) -alias alias -file cert path export in the 3rd step”

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report
  2. Julia Parent
    2022-05-25T20:55:11+00:00Added an answer on May 25, 2022 at 8:55 pm

    Assume you have a web app that is trying to access the restful service.

    You should first not use javax.net.ssl.* properties to set up your stores. Instead, use SSL configurations available in WebSphere. Comment all setProperty() calls. The second step is to add your service-server certificate to the truststore.

    Login to the web admin console

    • Security > SSL certificate and key management > Key stores and certificates > NodeDefaultTrustStore > Signer certificates
    • Click the Retrieve from port button to specify hostname, port 443 and Alias.
    • Click the Retrieve singer information button.
    • Verify that the correct certificate has been imported (parent).
    • Save and then restart.

    Some versions imported the child certificate, but not the root. In that case you will need to manually download the root and intermediate certificates (e.g. You can import the child certificate via browser to NodeDefaultTrustStore. However, you will need to use Add button and not Retrieve...

    • 24
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

Sidebar

Ask A Question
  • How to Split String by space in C++
  • How To Convert A Pandas DataFrame Column To A List
  • How to Replace Multiple Characters in A String in Python?
  • How To Remove Special Characters From String Python

Explore

  • Home
  • Tutorial

Footer

ITtutoria

ITtutoria

This website is user friendly and will facilitate transferring knowledge. It would be useful for a self-initiated learning process.

@ ITTutoria Co Ltd.

Tutorial

  • Home
  • Python
  • Science
  • Java
  • JavaScript
  • Reactjs
  • Nodejs
  • Tools
  • QA

Legal Stuff

  • About Us
  • Terms of Use
  • Privacy Policy
  • Contact Us

DMCA.com Protection Status

Help

  • Knowledge Base
  • Support

Follow

© 2022 Ittutoria. All Rights Reserved.

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.