Java服务发起HTTPS请求报错:PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException
Java服务发起HTTPS请求报错:PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException
1.从域名的https导出下载证书文件
下载证书
第一步是要下载证书
去你程序要访问的网站,点击那个锁按钮,并点击查看详情(chrome浏览器)
2.切换到jre的/lib/security/下
切换到目录 ${JAVA_HOME}/jre/lib/security
D:\Program Files\Java\jdk1.8.0_11\jre\lib\security
3.##导入命令
如果界面是中文,输入:是
如果界面是英文,输入:yes
##测试的证书
##删除命令
keytool -delete -alias mycert_test -keystore cacerts
##导入命令
keytool -import -alias mycert_test -keystore cacerts -file F://_.nmio.comtest.crt
##查看命令
keytool -list -keystore cacerts -alias mycert_test
##查看密钥库
keytool -list -keystore cacerts
口令输入:changeit
查看证书,口令仍然是 changeit
#生产的证书
keytool -delete -alias mycert_pro -keystore cacerts
keytool -import -alias mycert_pro -keystore cacerts -file F://_.nmio.compro.crt
keytool -list -keystore cacerts -alias mycert_pro
Java服务发起HTTPS请求报错:PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException的更多相关文章
- 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 ...
- 报错PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target"
今天在调用第三方HTTPS接口的时候,一直显示这个报错,然后百度很久,有2种解决方法,一个是说自己手动去导入,第二种用代码忽略证书验证.我用二种方式, 复制即用, public void test2( ...
- 【问题记录】Java服务发起HTTPS请求报错:PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException
问题报错 今天上线了我开发的一个OAuth2单点登录客户端的实现,在测试系统验证没问题,到生产环境由于单点登录服务端HTTPS协议,报错如下: I/O error on POST request fo ...
- java程序中访问https时,报 PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
在java中使用https访问数据时报异常: Caused by: sun.security.validator.ValidatorException: PKIX path building fail ...
- mvn 编译报错mavn sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested targ
mavn 编译报错: mavn sun.security.validator.ValidatorException: PKIX path building failed: sun.security.p ...
- 解决 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 ...
- javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certificatio
场景:Java调用PHP接口,代码部署在服务器上后,调用报错,显示PHP服务器那边证书我这边服务器不信任(我猜的). 异常信息: 2019-08-06 14:00:09,102 [http-nio-4 ...
- 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: ...
- PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
注:网上搜来的快照,暂未验证 在java代码中请求https链接的时候,可能会报下面这个错误javax.net.ssl.SSLHandshakeException: sun.security.vali ...
- sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
httpclient-4.5.jar 定时发送http包,忽然有一天报错,http证书变更引起的. 之前的代码 try { CloseableHttpClient httpClient = build ...
随机推荐
- Fluid 给数据弹性一双隐形的翅膀 -- 自定义弹性伸缩
简介: 弹性伸缩作为 Kubernetes 的核心能力之一,但它一直是围绕这无状态的应用负载展开.而 Fluid 提供了分布式缓存的弹性伸缩能力,可以灵活扩充和收缩数据缓存. 它基于 Runtime ...
- [Go] VsCode 的 Golang 环境设置与代码跳转支持
终端执行: go env -w GO111MODULE=on go env -w GOPROXY=https://goproxy.io,direct WIndows下自定义指定 GOPATH 路径 ...
- [FAQ] Windows 终端 git status 不识别文件名大小写的修改
当我们修改了文件名的大小写,git status 显示没有文件改动. 出现这种情况,首先看一下 git 的配置项是否忽略了文件问大小写: $ git config core.ignorecase ...
- 为何 WPF 对 vcruntime140 有引用
通过阅读 WPF 官方开源仓库的代码和文档,可以了解到在进行独立发布的时候会在仓库里面带上 vcruntime140 的原因 在独立发布的时候,可以在仓库里面找到 vcruntime140.dll 这 ...
- 优秀的 Modbus 主站(主机、客户端)仿真器、串口调试工具
目录 优秀的 Modbus 主站(主机.客户端)仿真器.串口调试工具 主要功能 软件截图 优秀的 Modbus 主站(主机.客户端)仿真器.串口调试工具 modbus master,modbus,串口 ...
- Codeforces Good Bye 2023
A. 2023 正常签到. void solve() { int n, k, ok = 1; cin >> n >> k; int t = 2023; while(n --) ...
- 使用小波分析和深度学习对心电图 (ECG) 进行分类 mcu-ai低成本方案 mcu-ai低成本方案
具体的软硬件实现点击 http://mcu-ai.com/ MCU-AI技术网页_MCU-AI人工智能 此示例说明如何使用连续小波变换 (CWT) 和深度卷积神经网络 (CNN) 对人体心电图 (EC ...
- PostgreSQL数据库管理工具pgAdmin4界面如何设置为中文显示
首发微信公众号:SQL数据库运维 原文链接:https://mp.weixin.qq.com/s?__biz=MzI1NTQyNzg3MQ==&mid=2247485130&idx=1 ...
- GEOJSON 的渲染实例
createGeojson:function(arr) { let geoArr=[]; for(let i=0;i<arr.length;i++) { let obj={ "type ...
- 一个网格合并(weld)小工具
在日常开发中会有需求合并多个Mesh网格,并且它们重合处的顶点也要合并,而并非合并成两个subMesh. 而近期刚好在学习Geomipmap的细分,需要把多个mesh块进行合并,于是写了这个脚本 (简 ...