工作日志,证书无效 unable to find valid certification path to requested target
工作日志,证书无效 unable to find valid certification path to requested target
最近被这个问题弄得头大。导致所有用到 se.transmode.gradle:gradle-docker:1.2 的项目全部都无法启动!也不知道为什么会这样,其他同事的项目却可以正常打包运行!花了大半天的时间终于折腾好了。
异常情况:

异常日志:
org.gradle.api.ProjectConfigurationException: A problem occurred configuring root project 'xxxx'.
Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all artifacts for configuration ':classpath'.
... 91 more
Caused by: org.gradle.internal.resolve.ModuleVersionResolveException: Could not resolve com.github.jnr:jffi:[1.2.1, 1.3.0).
Required by:
project : > se.transmode.gradle:gradle-docker:1.2 > com.github.docker-java:docker-java:0.9.0 > com.github.jnr:jnr-unixsocket:0.3 > com.github.jnr:jnr-ffi:1.0.3
... 110 more
Caused by: org.gradle.internal.resolve.ModuleVersionResolveException: Failed to list versions for com.github.jnr:jffi.
... 136 more
Caused by: org.gradle.api.resources.ResourceException: Unable to load Maven meta-data from https://repo.maven.apache.org/maven2/com/github/jnr/jffi/maven-metadata.xml.
... 142 more
Caused by: org.gradle.internal.resource.transport.http.HttpRequestException: Could not HEAD 'https://repo.maven.apache.org/maven2/com/github/jnr/jffi/maven-metadata.xml'.
... 149 more
Caused by: 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
... 168 more
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
... 190 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
... 196 more
解决思路
网上找了一些解决方法,都是导出证书后添加到本地。第一次遇到这个问题,也不知道从哪里导出证书。看到日志中提示Failed to list versions for com.github.jnr:jffi. 。开始怀疑是因为证书失效导致的错误,于是将maven仓库中jffi 的证书导入并添加到本地,重启IDEA后,还是失败了。一瞬间,迷茫了。开始尝试导入其他网址的证书;尝试换gradle docker plugin;连重启电脑的方法都用上了。折腾了好长时间,结果都是以失败告终。
最后又重新看了一遍日志 se.transmode.gradle:gradle-docker:1.2 > com.github.docker-java:docker-java:0.9.0 > com.github.jnr:jnr-unixsocket:0.3 > com.github.jnr:jnr-ffi:1.0.3 抱着try 一 try的心态导入了 jnr-ffi:1.0.3 的证书,结果成功了,心态蹦了。蹦了。了。
具体步骤
第一步:分析日志,列出证书失效的嫌疑jar。
第二步:进入maven 仓库(可能是私服),找到对应的jar页面。
第三步:导出证书到本地

第四步:用管理员身份打开cmd窗口,执行./keytool -import -alias 别名 -keystore cacerts -file 证书地址 命令添加证书,提示“证书已添加到密钥库中”即可。

第五步:重启IDEA
这次的坑给我的教训
日志看仔细。如果一次没有成功,切不可否定自己的观点,多试几次。可以把其他的嫌疑对象,都添加进来。
工作日志,证书无效 unable to find valid certification path to requested target的更多相关文章
- idea使用maven下载jar包,出现证书校验问题问题,unable to find valid certification path to requested target
每次从github上下载下来的项目都报如下错误could not transfer artifact org.springframework.boot:spring-boot-starter-pare ...
- Flutter配置环境报错“PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target”
背景:最近看了很多Flutter漂亮的项目,想要尝试一下.所有环境都搭建好之后,按照文档一步一步配置(抄袭),但始终报如下图错误. PKIX path building failed: sun.sec ...
- Android Studio出现:Cause: unable to find valid certification path to requested target问题解决
Android Studio , Flutter , IDEA 工程报错 unable to find valid certification path to requested target 最新解 ...
- 解决PKIX:unable to find valid certification path to requested target 的问题
这两天在twitter服务器上忽然遇到这样的异常: e: sun.security.validator.ValidatorException: PKIX path building failed: s ...
- 解决 java 使用ssl过程中出现"PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target"
今天,封装HttpClient使用ssl时报一下错误: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorExc ...
- 解决PKIX(PKIX path building failed) 问题 unable to find valid certification path to requested target
最近在写java的一个服务,需要给远程服务器发送post请求,认证方式为Basic Authentication,在请求过程中出现了 PKIX path building failed: sun.se ...
- Pop3_解决PKIX:unable to find valid certification path to requested target 的问题
最近有公司pop3协议接收pp邮箱出现异常,连不上服务器,错误内容: e: sun.security.validator.ValidatorException: PKIX path building ...
- unable to find valid certification path to requested target
Error : javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path bu ...
- 解决flutter:unable to find valid certification path to requested target 的问题
1.问题 周末在家想搞搞flutter,家里电脑是windows的,按照官网教程一步步安装好以后,创建flutter工程,点击运行,一片红色弹出来,WTF? PKIX path building fa ...
随机推荐
- Pikachu-File Inclusion, Unsafe file download & Unsafe file upload
Pikachu-File Inclusion, Unsafe file download & Unsafe file upload 文件包含漏洞 File Inclusion(文件包含漏洞)概 ...
- 【转载】单线程Redis性能为何如此之高?
Redis的优势 性能高不仅跟线程模型有关,它有很多原因,主要有如下3点: 基于内存: 单线程,但IO多路复用的利用率高: 数据结构为高性能优化. 下面分别阐述. Redis的优势:基于内存 性能高低 ...
- Jmeter+Ant+Jenkins集成抛出异常java.lang.ClassNotFoundException: javax.mail.internet.MimeMessage
一.问题描述 二.解决方法 下载javax.mail.jar插件,并将该插件放到%ANT_HOME%\lib目录下即可解决,下载地址:https://javaee.github.io/javamail ...
- Retrofit-草稿
1.GSONFormat 2.动态代理 https://www.cnblogs.com/maohuidong/p/7992894.html retrofit的核心就是动态代理
- Dubbo学习系列之十二(Quartz任务调度)
Quartz词义为"石英"水晶,然后聪明的人类利用它发明了石英手表,因石英晶体在受到电流影响时,它会产生规律的振动,于是,这种时间上的规律,也被应用到了软件界,来命名了一款任务调度 ...
- vs2017 C# ActiveX浏览器插件 创建 发布 C# windows窗体控件库(.NET Framework)注意事项
vs2017需要安装插 插件下载地址:https://marketplace.visualstudio.com/items?itemName=VisualStudioProductTeam.Micro ...
- 剑指offer笔记面试题4----二维数组中的查找
题目:在一个二维数组中,每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序.请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数. 测试用例: 二维数组中包含 ...
- dpwwn:2 Vulnhub Walkthrough
此镜像配置了静态IP地址:10.10.10.10,需要调整下网络 主机层扫描: ╰─ nmap -p1-65535 -sV -A 10.10.10.10 80/tcp open http ...
- 初级模拟电路:4-1 BJT交流分析概述
回到目录 BJT晶体管的交流分析(也叫小信号分析)是模拟电路中的一个难点,也可以说是模电中的一个分水岭.如果你能够把BJT交流分析的原理全都搞懂,那之后的学习就是一马平川了.后面的大部分内容,诸如:场 ...
- 附003.Kubeadm部署Kubernetes
一 kubeadm介绍 1.1 概述 Kubeadm 是一个工具,它提供了 kubeadm init 以及 kubeadm join 这两个命令作为快速创建 kubernetes 集群的最佳实践. k ...