Cause: unable to find valid certification path to requested target

2023-11-08 13:12

本文主要是介绍Cause: unable to find valid certification path to requested target,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

       前话:最近,已经两个月没有怎么打开Android studio开发工具了,只因工作原因到后端帮忙干了两个月,期间由于c盘不堪重负,还经历了对系统盘进行迁移,后面打开之前的As项目,运行报错,报错信息为:Cause: unable to find valid certification path to requested target

        接下来就是各种尝试与百度,其中试过好多方式,有:对SDK的tool进行删除和更新,还有网上说的一大堆,有的是要自己生成证书,但是尝试无果,可能是个人的原因,操作的姿势不对,皆没有搞定;

        怀着不屈不挠的信念,其中还以为是无法下载maven库的原因,还去消费了10元200g的梯子服务,最后还是没有结果,后面不断的找资料,其中有关就是说可能证书没有没信任,就尝试一下,结果真的就可以了,以下就是我分享的操作过程。

        按查询的资料所得,我们要在maven网站下载对应的证书,再导入到证书里面,具体操作顺序如下:

1、先打开指定的maven网站https://jitpack.io/

打开网站后你可以看到地址栏目的地方有一把锁,点击锁,按如下步骤操作

导出的文件是

接着就是到自己的jre目录去导入我们的证书;

2、找到 计算机本地密钥库:

Windows:C:\Program Files\Java 或 C:\Program Files (x86)\Java
macOS:/Library/Java/JavaVirtualMachines
Linux:通常在 /usr/lib/jvm 或 /usr/java 目录下
例如我的就是在以下目录:C:\java\jre\lib\security

3.导入证书:

打开cmd命令行

查看证书指令:初始密码 changeit

keytool -list -keystore "C:\Program Files\Java\jdk1.8.0_40\jre\lib\security\cacerts"

黄色部分的路径就是自己本地证书的路径,根据提示输入密码,即可看到自己的...都懂的

导入证书指令:(这是关键步骤)

keytool -importcert -alias mycert -keystore "C:\Program Files\Java\jdk1.8.0_40\jre\lib\security\cacerts" -file "C:\Users\Lance\Desktop\fsdownload\jitpack.io.crt"

在cmd命令行中输入以上指令,其中蓝色部分是本地证书文件,绿色部分是maven额证书文件,通过命令将证书导入,操作完成之后重启试试,如果没事就OK了,我的没事☺

4.重启android studio开发工具,运行项目
 

这篇关于Cause: unable to find valid certification path to requested target的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/370091

相关文章

Unable to instantiate Action, goodsTypeAction, defined for 'goodsType_findAdvanced' in namespace '/

报错: Unable to instantiate Action, goodsTypeAction,  defined for 'goodsType_findAdvanced' in namespace '/'goodsTypeAction......... Caused by: java.lang.ClassNotFoundException: goodsTypeAction.......

Caused by: android.view.WindowManager$BadTokenException: Unable to add window -- token android.os.B

一个bug日志 FATAL EXCEPTION: main03-25 14:24:07.724: E/AndroidRuntime(4135): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.syyx.jingubang.ky/com.anguotech.android.activity.Init

MongoDB学习—(6)MongoDB的find查询比较符

首先,先通过以下函数向BookList集合中插入10000条数据 function insertN(obj,n){var i=0;while(i<n){obj.insert({id:i,name:"bookNumber"+i,publishTime:i+2000})i++;}}var BookList=db.getCollection("BookList")调用函数,这样,BookList

android.database.CursorIndexOutOfBoundsException: Index 5 requested, with a size of 5

描述: 01-02 00:13:43.380: E/flyLog:ChatManager(963): getUnreadChatGroupandroid.database.CursorIndexOutOfBoundsException: Index 5 requested, with a size of 5 01-02 00:13:43.380: E/flyLog:ChatManager(

解决The valid characters are defined in RFC 7230 and RFC 3986

解决方法: 一、更换低版本的Tomcat;(我选的方案) 二、参考:https://blog.csdn.net/qq_32365919/article/details/82055800

【NodeJS】Error: Cannot find module 'ms'

转载自:http://blog.csdn.net/echo_ae/article/details/75097004 问题: Error: Cannot find module 'ms'at Function.Module._resolveFilename (module.js:469:15)at Function.Module._load (module.js:417:25)at Module

leetCode#125. Valid Palindrome

Description Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example, “A man, a plan, a canal: Panama” is a palindrome. “race a car

leetCode#448. Find All Numbers Disappeared in an Array

Description Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once. Find all the elements of [1, n] inclusive that do not appear in this

leetcode#32. Longest Valid Parentheses

题目 Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring. For "(()", the longest valid parentheses substring is "()", wh

访问controller404:The origin server did not find a current representation for the target resource

ider build->rebuild project。Rebuild:对选定的目标(Project),进行强制性编译,不管目标是否是被修改过。由于 Rebuild 的目标只有 Project,所以 Rebuild 每次花的时间会比较长。 参考:资料