Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The solution of abnormal PKIX path building failed in ValidatorException

2025-04-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "the solution to abnormal PKIX path building failed in ValidatorException". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "the solution to abnormal PKIX path building failed in ValidatorException".

Maven download relies on throwing an exception of ssl digital certificate: PKIX path building failed: SunCertPathBuilderException: unable to find valid certification path to requested target, recording the cause and effect of the problem, that is, the solution.

Cause of the problem

In my blog: Maven depends on the reason and solution of download failure. I set the address of maven's warehouse to 'http://maven.aliyun.com/nexus/content/groups/public', although it says it begins with http. The actual visit is a https site issued by GlobalSign Organization Validation CA, and the certificate issued by this ca institution has not been stored in jre/lib/security 's trusted certificate container cacerts. Therefore, an exception is reported that the ssl digital certificate is not trusted.

If you don't believe it, you can use this command:

Keytool-list-keystore $JAVA_HOME/jre/lib/security/cacerts

The default password is: 'changeit'

Check the trusted ca list to see if there is any GlobalSign.

Solution.

The solution is also very simple, just import the questioned certificate into cacerts, which has been explained by many other blogs, but they only focus on how the keytool command imports the certificate, and do not explain to the reader how to obtain the imported certificate.

Obtain the certificate in question

In the log when mvn throws PKIX path building failed: SunCertPathBuilderException, we can also see which image warehouse address's certificate is untrusted, so visit this site with a chrome browser

Click the lock icon-> Certificate-> details-> copy to File-> Select Base64-encoded X.509 format in the upper left corner, and save the certificate to the local directory

After obtaining the certificate, it is assumed that your certificate storage path is / tmp/caCert.cer.

Import a certificate to cacerts

Execute the following command

Keytool-import-file / tmp/caCert.cer-keystore $JAVA_HOME/jre/lib/security/cacerts

Enter cacerts password: changeit

Import succeeded, end

At this point, I believe you have a deeper understanding of "the solution to abnormal PKIX path building failed in ValidatorException". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report