当前位置:网站首页>Solve the problem of "suncertpathbuilderexception: unable to find valid certification path to requested target"
Solve the problem of "suncertpathbuilderexception: unable to find valid certification path to requested target"
2022-04-23 11:07:00 【Love blog uncle】
solve 『SunCertPathBuilderException:unable to find valid certification path to requested target』 problem
* problem
stay maven When compiling , A certificate verification error occurred , part log as follows :
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
This problem is usually when accessing maven Web sites that depend on Libraries (https Of ) when , The certificate was replaced , And then it leads to .
Why are certificates replaced ? The possible reasons are , The proxy server acts as a middleman , stay https During transmission , Replace the server's certificate with , Then you can listen https The flow of . Usually , That's what the company does . Here, the proxy server takes advantage of https The key exchange process of the protocol , You can refer to this article : Eliminate illiteracy HTTPS and SSL/TLS agreement
Solve this problem , There are two ways .
* Method 1: by maven Add attribute maven.wagon.http.ssl.insecure=true
stay mvn Add... After the order -Dmaven.wagon.http.ssl.insecure=true. This property is to let maven Ignore security , No longer verify the server's certificate ( At this time, the server's certificate may be replaced ).
mvn -Dmaven.wagon.http.ssl.insecure=true package
* Method 2: Add certificate to cacerts in
Environmental Science :Windows.
cacerts It contains a lot of CA certificate , Position in Java Installation directory : 『Java\jdk1.8.0_65\jre\lib\security\cacerts』.
Execute the following command , Add certificate to cacerts in :
keytool.exe -importcert -file < New certificate > -keystore Java\jdk1.8.0_65\jre\lib\security\cacerts -storepass changeit
< New certificate > It can be cer Format , for example ,xxx.cer.
Executing this command will prompt you if you trust this certificate , Input yes, enter . Then the certificate is added cacerts It's in . part log as follows :
Trust this certificate? [no]: yes
Certificate was added to keystore
◇ About cacerts Explanation
Reference resources : https://www.ibm.com/support/knowledgecenter/SSYKE2_8.0.0/com.ibm.java.security.component.80.doc/security-component/keytoolDocs/cacertsfile.html
A certificates file named “cacerts” resides in the security properties directory, java.home\lib\security, where java.home is the runtime environment directory (the jre directory in the SDK or the top-level directory of the Java 2 Runtime Environment).
The “cacerts” file represents a system-wide keystore with CA certificates. System administrators can configure and manage that file using keytool, specifying “jks” as the keystore type. The “cacerts” keystore file ships with several root CA certificates. The initial password of the “cacerts” keystore file is “changeit”. System administrators should change that password and the default access permission of that file when installing the SDK.
* Reference resources
版权声明
本文为[Love blog uncle]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231102106386.html
边栏推荐
- Visual common drawing (III) area map
- Derivation and regularization
- Special members and magic methods
- Excel · VBA custom function to obtain multiple cell values
- Mysql系列SQL查询语句书写顺序及执行顺序详解
- 防止web项目中的SQL注入
- Mba-day6 logic - hypothetical reasoning exercises
- Chapter 1 of technical Xiaobai (express yourself)
- 全栈交叉编译X86完成过程经验分享
- Introduction to neo4j authoritative guide, recommended by Qiu Bojun, Zhou Hongxiang, Hu Xiaofeng, Zhou Tao and other celebrities
猜你喜欢

Canvas详解

精彩回顾|「源」来如此 第六期 - 开源经济与产业投资

Promise details

Learning Notes 6 - Summary of several deep learning convolutional neural networks

Google Earth Engine(GEE)——将原始影像进行升尺度计算(以海南市为例)

Ueditor -- limitation of 4m size of image upload component

Jupyter Lab 十大高生产力插件

Solutions to common problems in visualization (IX) background color

Microsoft Access database using PHP PDO ODBC sample

初探 Lambda Powertools TypeScript
随机推荐
闹钟场景识别
Microsoft Access database using PHP PDO ODBC sample
比深度学习更值得信赖的模型ART
Mba-day6 logic - hypothetical reasoning exercises
vm设置静态虚拟机
VIM usage
Typora operation skill description (I)
采用百度飞桨EasyDL完成指定目标识别
Visual solutions to common problems (VIII) mathematical formulas
@Valid, @ validated learning notes
GO接口使用
Google Earth engine (GEE) - scale up the original image (taking Hainan as an example)
精彩回顾|「源」来如此 第六期 - 开源经济与产业投资
防止web项目中的SQL注入
The songbird document editor will be open source: starting with but not limited to markdown
How to Ping Baidu development board
初探 Lambda Powertools TypeScript
《Neo4j权威指南》简介,求伯君、周鸿袆、胡晓峰、周涛等大咖隆重推荐
Learning website materials
Use of SVN: