解决unable to find valid certification path to requested target
问题描述
最近java程序去调用远程服务器接口时报错了:
I/O error on POST request for “https://XXX.xyz/create”: sun.secu
rity.validator.ValidatorException: PKIX path building failed: sun.security.provi
der.certpath.SunCertPathBuilderException: unable to find valid certification pat
h to requested target;
远程的接口地址用的是https,SSL证书也是我刚申请的,新的。
问题原因
JDK中没有收录你这个站点的SSL证书,它找不到你这个域名对应https协议的SSL认证信息,所以判定为非法!
解决方案
下载网站证书
点击地址栏左侧 锁标志:


点详细信息

保存为
abc.crt

生成安全证书
切换到jre的/lib/security/下:

执行命令:
keytool -import -alias abc -keystore cacerts -file D://abc.crt
库密钥口令输入:changeit


证书导入成功,查看证书,密钥仍然是changeit
keytool -list -keystore cacerts -alias abc
备注:
-alias 指定别名(推荐和证书同名)
-keystore 指定存储文件(此处固定)
-file 指定证书文件全路径(证书文件所在的目录)
注意:当切换到 cacerts 文件所在的目录时,才可指定 -keystore cacerts, 否则应该指定全路径;
此时命令行会提示你输入cacerts证书库的密码,敲入changeit即可,这是java中cacerts证书库的默认密码,当然也可自行修改。
重启java程序
一般来讲就正常了。
解决unable to find valid certification path to requested target的更多相关文章
- 彻底解决unable to find valid certification path to requested target
安装证书. 下载证书 第一步是要下载证书 去你程序要访问的网站,点击那个锁按钮,并点击查看详情(chrome浏览器) 点击View certificate 点击详细信息 复制到文件 下一步 选择格式 ...
- Maven:sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
还是记录使用 maven 时遇到的问题. 一.maven报错 maven package 进行打包时出现了以下报错: Non-resolvable parent POM for com.wpbxin: ...
- 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 最新解 ...
- 解决 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 ...
- 解决flutter:unable to find valid certification path to requested target 的问题
1.问题 周末在家想搞搞flutter,家里电脑是windows的,按照官网教程一步步安装好以后,创建flutter工程,点击运行,一片红色弹出来,WTF? PKIX path building fa ...
- maven配置下载包 解决SunCertPathBuilderException:unable to find valid certification path to requested target
解决 『SunCertPathBuilderException: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 ...
- Pop3_解决PKIX:unable to find valid certification path to requested target 的问题
最近有公司pop3协议接收pp邮箱出现异常,连不上服务器,错误内容: e: sun.security.validator.ValidatorException: PKIX path building ...
- https编程遇到PKIX:unable to find valid certification path to requested target 的问题
https编程遇到PKIX:unable to find valid certification path to requested target 的问题 2016-12-01 解决方案见:解决PKI ...
随机推荐
- 银河麒麟上面 ntopng的安装与使用
银河麒麟上面 ntopng的安装与使用 背景 一直想用Grafana监控网络流量 但是断断续续尝试了一周的时间都没有搞定. 发现这一块已经进入了瓶颈. 比较无奈的情况下回到了原来的iftop/iptr ...
- [转帖]kafka指定topic设置消息留存时间
背景 单个主题消息量庞大,需要指定这个主题的消息留存时间缩小点 执行命令 ./bin/kafka-configs.sh --bootstrap-server node1:9092 --entity-t ...
- [转帖]harbor镜像仓库清理操作
https://www.cnblogs.com/FengGeBlog/p/15517706.html 两年前清理过一次harbor镜像,而现在又要面临清镜像的操作了,笔者目前所在的公司镜像是存放在ce ...
- 【转帖】x86服务器中网络性能分析与调优(高并发、大流量网卡调优)
最近在百度云做一些RTC大客户的项目,晚上边缘计算的一台宿主机由于CPU单核耗被打满,最后查到原因是网卡调优没有生效,今天查了一下网卡调优的资料,欢迎大家共同探讨. 一.网卡调优方法 1.Broadc ...
- 【转贴】java 进程运行状态图解
java 进程运行状态图解 原文博客地址 https://www.cnblogs.com/GooPolaris/p/8079490.html java中进程的状态有 6 种: NEW(新建).RU ...
- Mysql localhost 无法登录 root用户的处理过程
问题说明: 前段时间同事修改密码, 但是发现修改了密码之后,外面可以连接root用户, 但是本地无法连接了. 怀疑是密码修改存在问题,需要重新进行处理 这里进行简单的描述. 问题现象 使用 mysql ...
- 定位解析一个因脚本劫持导致webpack动态加载异常的问题
问题描述 项目现场的前端项目在点击顶部的导航栏切换不同的模块时,会有小概率出现模块加载报错的情况: 我们的前端项目里是有基于react-loadable做的懒加载的,上图的12.be789340.ch ...
- R2M分布式锁原理及实践
作者:京东科技 张石磊 1 案例引入 名词简介: 资源:可以理解为一条内容,或者图+文字+链接的载体. 档位ID: 资源的分类组,资源必须归属于档位. 问题描述:当同一个档位下2条资源同时审批通过时, ...
- NetCore高级系列文章01---创建项目及配置文件
.NET Core是适用于 Windows.Linux 和 macOS 的免费.开源托管的计算机软件框架,作为.NET开发人员,全面拥抱.NetCore将成为趋势. 本系列文章将分为两大部分讲解.Ne ...
- Gorm 数据库表迁移与表模型定义
目录 一.Docker快速创建MySQL实例 1.1 创建 1.3 创建数据库 二.AutoMigrate介绍与使用 2.1 AutoMigrate介绍 2.2 AutoMigrate 基本使用 三. ...