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的更多相关文章

  1. 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 ...

  2. 报错PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target"

    今天在调用第三方HTTPS接口的时候,一直显示这个报错,然后百度很久,有2种解决方法,一个是说自己手动去导入,第二种用代码忽略证书验证.我用二种方式, 复制即用, public void test2( ...

  3. 【问题记录】Java服务发起HTTPS请求报错:PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException

    问题报错 今天上线了我开发的一个OAuth2单点登录客户端的实现,在测试系统验证没问题,到生产环境由于单点登录服务端HTTPS协议,报错如下: I/O error on POST request fo ...

  4. 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 ...

  5. 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 ...

  6. 解决 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 ...

  7. 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 ...

  8. 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: ...

  9. 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 ...

  10. 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 ...

随机推荐

  1. CCO x Hologres:实时数仓高可用架构再次升级,双11大规模落地

    ​简介:本文将会介绍今年是如何在去年基础上进行实时数仓高可用架构升级,并成功大规模落地双11. 作者 | 梅酱 来源 | 阿里技术公众号 一 2021年双11总结 2021年阿里巴巴双11期间,由CC ...

  2. 【视频特辑】提效神器!如何用Quick BI高效配置员工的用数权限

    ​简介:随着企业数字化进程逐步加速,企业所产生和积累的数据资源日益增多.每当员工的用数权限发生变动,管理员都需要进行复杂繁琐的重复性配置流程,不仅耗时耗力还容易出错. 如何能便捷地对员工用数权限进行高 ...

  3. 阿里云云效发布研发协同工具,以新的产研协同工作方式助力实现BizDevOps

    ​简介:2021云栖大会云效BizDevOps分论坛上,阿里云云效技术负责人陈鑫发布阿里云云效产品研发协同工具支撑ALPD理论,以新的产研协同工作方式助力实现BizDevOps. 编者按:10月21日 ...

  4. dotnet C# 基于 INotifyPropertyChanged 实现一个 CLR 属性绑定辅助类

    习惯了 WPF 或 UWP 等的依赖属性的绑定机制之后,我在写 CLR 属性时,有时也期望将两个 CLR 属性给绑定到一起.在 dotnet 里,提供了 System.ComponentModel.I ...

  5. Springboot+Prometheus+grafana 制作自己的业务监控

    目录 知识储备 系统架构 开始实现 生成业务指标 经典实现方法 自己的实现方案 引入依赖 配置文件 注册自己的指标[我这里用的是guaua格式数据] 写入指标 效果展示 配置prometheus 抓取 ...

  6. JWT 构建Rails API 授权登录

    目录 安装jwt组件 创建base_controller.rb控制器 配置路由 用户登陆-api接口 验证用户token信息-api接口(*) 参考下面的连接 使用Rails构建JSON-API ht ...

  7. AI编译器CINN v.s TVM 中CodeGen 源码解读

    如下的技术点梳理仅以「日常优化工作」为牵引点,涉及哪个模块,就具体去看哪个模块的代码. 一.CINN 框架 CINN 中CodeGen之后的代码编译主要交给了Compiler类来负责.核心的函数主要是 ...

  8. 【原创】不同RTOS POSIX接口的实现差异

    目录 前言 POSIX简介 RTOS对POSIX的实现情况 Zephyr FreeRTOS RTOS提供的POSIX接口实时吗? nanosleep Timer-不同linux版本和xenomai的实 ...

  9. C#/.NET/.NET Core优秀项目和框架2024年4月简报

    前言 公众号每月定期推广和分享的C#/.NET/.NET Core优秀项目和框架(每周至少会推荐两个优秀的项目和框架当然节假日除外),公众号推文中有项目和框架的介绍.功能特点.使用方式以及部分功能截图 ...

  10. C# 程序集、模块和类型概念及关系

    目录 C# 程序集.模块和类型概念及关系 概述 程序集 模块 类型 程序集.模块和类型的关系 总结 引用 C# 程序集.模块和类型概念及关系 概述 在 C# 中,程序集.模块和类型是构成 .NET 应 ...