解决错误:unable to find valid certification path to requested target
来源:互联网 发布:淘宝账号管理在哪 编辑:程序博客网 时间:2024/05/16 17:28
现象分析
今天的小目标是通过Android Studio发布Library到私有仓库(公司私有仓库:https://maven.bingosoft.net ),然而,在最后执行uploadArchives(上传包)的时候突然报了如下错误:
unable to find valid certification path to requested target
从图中看出,大致原因是Android Studio在执行上传动作的时候,遇到了 SSL问题,目测是因为目标仓库是 https的协议,如下:
通常出现这种错误解决办法都是【往JDK里面导入证书】
解决办法
从网站上下载证书
推荐使用IE来导出cer证书,其他浏览器比较隐秘。个中细节不详述,请看下面:
证书导出后假设名字叫做 server.cer
通过keytool命令导入server.cer
keytool -import -file cerPath -keystore "%JAVA_HOME%\jre\lib\security\cacerts" -alias server
其中cerPath是刚导出来的 server.cer 文件路径, -alias server 表示别名是 server 。
顺利的话可以看到如下信息,表示正常导入到 %JAVA_HOME% 里面:
重新执行uploadArchives
理论上来说,已经将证书导入JDK,应该正常执行才对,没想到依旧报文初的错误。郁闷良久,突然想起Android Studio 里面自带了JDK, 毕竟导入到 %JAVA_HOME% 是系统层面的。 打开 SDK Location,如笔者所想:
果真如此,Android Studio 推荐使用的是:
/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home
于是乎,按照上面的步骤,将server.cer 导入到 这个JDK里面。
请注意图片上的红字,在Android Studio里面的JDK,默认的口令是 changeit ,不是 系统登录密码。最后别忘记确认:
重启Android Studio,执行 uploadArchives 即可!
- 解决错误:unable to find valid certification path to requested target
- unable to find valid certification path to requested target'解决办法
- unable to find valid certification path to requested target
- unable to find valid certification path to requested target
- SunCertPathBuilderException: Unable To Find Valid Certification Path To Requested Target
- Unable to find valid certification path to requested target
- SunCertPathBuilderException: unable to find valid certification path to requested target
- unable to find valid certification path to requested target
- 彻底解决unable to find valid certification path to requested target
- 20170704unable to find valid certification path to requested target
- 解决PKIX path building failed的问题unable to find valid certification path to requested target
- 请求https错误: unable to find valid certification path to requested target
- 请求https错误: unable to find valid certification path to requested target
- 解决PKIX: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
- 解决PKIX:unable to find valid certification path to requested target 的问题
- 解决PKIX:unable to find valid certification path to requested target 的问题
- 读书系统
- 小米系统更新后android studio 通过USB安装报错:install_canceled_by_user
- opencv学习之角点检测
- lua 协程,在cocos2dx做战斗的理解
- Table View Programming Guide for iOS
- 解决错误:unable to find valid certification path to requested target
- SSH框架整合注册登录下载链接【转】
- iOS打开应用提示未受信任的企业级开发者
- spring boot 拦截器的实现以及遇到的问题的解决方案
- BLE蓝牙中的安全连接(Secure Connections)
- SIP协议详解&eXosip源码库用法分析
- spring getbean 方法分析
- JavaScript中把赋值运算作为判断条件是什么结果?
- beego 的 注释路由