彻底解决unable to find valid certification path to requested target
安装证书。
下载证书
第一步是要下载证书
去你程序要访问的网站,点击那个锁按钮,并点击查看详情(chrome浏览器)
点击View certificate
点击详细信息
复制到文件
下一步
选择格式
生成的名称,最后保存
这里我保存在的D盘根目录下叫abc.cer
导入证书
切换到jre的/lib/security/下
执行如下命令
keytool -import -alias abc -keystore cacerts -file D://abc.cer
其中:
-alias 指定别名(推荐和证书同名)
-keystore 指定存储文件(此处固定)
-file 指定证书文件全路径(证书文件所在的目录)
注意:当切换到 cacerts 文件所在的目录时,才可指定 -keystore cacerts, 否则应该指定全路径;
此时命令行会提示你输入cacerts证书库的密码,敲入changeit即可,这是java中cacerts证书库的默认密码,当然也可自行修改。
库密钥口令输入:changeit
将会看到如下的信息
是否信任:Y
证书导入成功
查看证书,密钥仍然是changeit
keytool -list -keystore cacerts -alias vbooking
至此证书导入成功。
注意:导入证书过程中,可能会遇到一个问题,如下所示
keytool 错误: java.io.FileNotFoundException: cacerts (拒绝访问)
出现这个问题的主要原因是
WIN7下的C:\Program Files以及C:\Program Files(x86)都是只有管理员权限才能访问的目录,所有写、修改操作都会遭遇”拒绝访问”,解决方案有两种:
1.将JDK安装在D盘
2.使用管理员权限打开命令行
更新证书时,先删除原来的证书,然后导入新的证书 keytool -list -keystore cacerts
keytool -delete -alias akazam_email -keystore cacerts
keytool -import -alias akazam_email -file akazam_email.cer -keystore cacerts -trustcacerts
彻底解决unable to find valid certification path to requested target的更多相关文章
- 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 ...
随机推荐
- ocketMQ概念模型
ocketMQ概念模型 https://blog.csdn.net/binzhaomobile/article/details/73332463 HTTPS://blog.CSDN.net/bin找M ...
- sklearn的基本使用
https://cloud.tencent.com/developer/news/58202 简介 今天为大家介绍的是scikit-learn.sklearn是一个Python第三方提供的非常强力的机 ...
- VS找不到头文件但是系统路径已经设置
有时候会出现打不开Include文件的问题,但是在系统包含include路径中已经设置,编译也没问题,就是一直有错误提示 这时候可以尝试在项目上点击右键,选择“下载项目”,然后再选择加载 如果还是不行 ...
- 深入理解JVM虚拟机
JVM平台上还可以运行其他语言,运行的是Class字节码.只要能翻译成Class的语言就OK了.挺强大的. JVM厂商很多 垃圾收集器.收集算法 JVM检测工具 关于类的加载: Java代码中,类型( ...
- Visual-Based Autonomous Driving Deployment from a Stochastic and Uncertainty-Aware Perspective
张宁 Visual-Based Autonomous Driving Deployment from a Stochastic and Uncertainty-Aware Perspective Le ...
- [转]Oringin 2016 安装教程
觉得有用的话,欢迎一起讨论相互学习~Follow Me 原文ll链接 http://www.downza.cn/soft/282296.html 打开setup.exe 一路Next和Yes,任意输入 ...
- 【LeetCode算法-53】Maximum Subarray
Given an integer array nums, find the contiguous subarray (containing at least one number) which has ...
- Vmvare v12下搭建Ubuntu操作系统-18.04-desktop-amd64.iso镜像环境
1.选择[典型],点击下一步. 2.找到ubuntu镜像文件所在位置,如图所示: 3.配置用户信息 4.设置安装位置 5.磁盘尽量大一些,笔者设置40g 6.自定义修改硬件信息 7.内存建 ...
- eclipse Maven Dependencies pom
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://mave ...
- springboot:自定义缓存注解,实现生存时间需求
需求背景:在使用springbot cache时,发现@cacheabe不能设置缓存时间,导致生成的缓存始终在redis中. 环境:springboot 2.1.5 + redis 解决办法:利用AO ...