szx*_*szx 32 certificate android-studio
忽略这个警告是否安全?它在我在Android Studio中创建新项目时出现:
Server's certificate is not trusted
Certificate details
Issued To
CN (Common Name) *.google.com
O (Organization) Google Inc
L (Locality) Mountain View
C (Country) US
ST (State or Province) California
Issued By
CN (Common Name) Google Internet Authority G2
O (Organization) Google Inc
C (Country) US
Validity Period
Valid from: 9/24/14
Valid until: 12/23/14
...
Run Code Online (Sandbox Code Playgroud)
日期看起来没问题,我检查了我的电脑的日期设置,以确定.为什么它会"不信任"?
GR *_*voy 43
Android Studio具有服务器证书的配置(这适用于其他IntelliJ平台,如PyCharm)
转到文件 - >设置.在" IDE设置"部分中,选择" 服务器证书"
我自己刚刚选中了" 自动接受"复选框,点击"应用",从不必处理它.如果您担心安全性,还可以选择在它们出现时一次添加1个.
在我的情况下,我这样做是因为我已经将*.google.com证书配置为已接受,但我仍然获得了弹出窗口.我怀疑指纹已经改变,如果我已经删除然后接受错误就会消失,但我决定通过选中复选框让它消失.
use*_*022 18
忽略该警告是不安全的.有人可能会尝试使用假证书进行中间人攻击,以便通过更新过程在您的计算机上安装恶意软件.这可能不会发生,但在安全方面做正确的事情总是更好.
您应该将您信任的根证书添加到Android Studio密钥库.密钥库的位置和默认密码应列在该警告的底部.例如,我的是~/Library/Caches/AndroidStudio/tasks/cacerts.接下来,您将要在服务器呈现的链中找到根证书.不幸的是,警告并未列出整个链条,因此需要一些工作才能找到它.该Google Internet Authority G2证书与用于签署Google网站证书的证书相同.您可以访问google.com,点击绿色锁定,然后点击连接标签中的"证书信息",在Chrome中查看链条.此时,您可以验证警告中的哈希值是否与真实G2证书的哈希值匹配.您还将看到根证书已命名Equifax Secure Certificate Authority.您可以从https://www.geotrust.com/resources/root-certificates/下载.接下来,您需要将其添加到密钥库:
keytool -import -alias equifaxca \
-file Equifax_Secure_Certificate_Authority.pem -keystore cacerts
Run Code Online (Sandbox Code Playgroud)
最后,重启Android Studio.除非有人实际出示假证书,否则该警告不应再出现在2018年8月22日.
添加带有非标准证书颁发机构(CA)签名的SSL证书的Maven存储库后,我遇到了此问题。
从命令行运行我的项目的gradle构建时,一切工作正常(我已将自定义CA添加到我的计算机Java安装cacerts中)。我在从Android Studio运行构建时遇到问题,并遇到如下错误:
> Could not resolve joda-time:joda-time:2.9.9.
> Could not get resource 'https://custom-maven-repo.com/repository/releases/joda-time/joda-time/2.9.9/joda-time-2.9.9.pom'.
> Could not GET 'https://custom-maven-repo.com/repository/releases/joda-time/joda-time/2.9.9/joda-time-2.9.9.pom''.
> sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
> PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
> unable to find valid certification path to requested target
Run Code Online (Sandbox Code Playgroud)
我下载了pem名为的自定义CA 的文件my-ca.pem。我尝试在“首选项” ->“ 工具” ->“ 服务器证书”中将其添加到Android Studio中,但这并没有解决。
我注意到Android Studio在处使用了嵌入式JDK(文件 -> 项目结构 -> SDK位置 -> JDK位置)/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home。为了使证书被接受,我(在Mac OS X上)运行了以下命令以添加证书,然后终止Android Studio Java进程:
/Applications/Android\ Studio.app/Contents/jre/jdk/Contents/Home/bin/keytool -import -alias my-ca -keystore /Applications/Android\ Studio.app/Contents/jre/jdk/Contents/Home/jre/lib/security/cacerts -storepass changeit -file path/to/my-ca.pem -noprompt
kill -9 $(ps -A | grep java | grep "Android Studio" | grep -v grep | awk '{print $1}')
Run Code Online (Sandbox Code Playgroud)
然后从Android Studio运行gradle构建即可。
另一种解决方案是使用文件 -> 项目结构 -> SDK位置 -> JDK位置中的菜单,将Android Studio设置为在安装了CA证书的计算机上使用自定义JDK。
| 归档时间: |
|
| 查看次数: |
53189 次 |
| 最近记录: |