android 不信任证书

标签 android ssl

我运行openssl s_client -connect mywishboard.com:443 | openssl x509 -noout -subject -issuer 我得到以下有关证书的信息(由客户端开发人员设置)

depth=2 C = IL, O = StartCom Ltd., OU = Secure Digital Certificate Signing, CN = StartCom Certification Authority
verify return:1
depth=1 C = IL, O = StartCom Ltd., OU = StartCom Certification Authority, CN = StartCom Class 1 DV Server CA
verify return:1
depth=0 CN = mywishboard.com
verify return:1
subject= /CN=mywishboard.com
issuer= /C=IL/O=StartCom Ltd./OU=StartCom Certification Authority/CN=StartCom Class 1 DV Server CA

然后我检查Settings/system/trusted certificats,发现 StartCom Ltd 就在其中 enter image description here

但是,当我尝试发出 https 请求时,它们会抛出

javax.net.ssl.SSLHandshakeException:
java.security.cert.CertPathValidatorException: 
Trust anchor for certification path not found

如果我使用curl -I https://mywishboard.com/xxx,它会返回

curl: (60) server certificate verification failed. CAfile: /etc/ssl
/certs/ca-certificates.crt CRLfile: none

该证书是否格式错误,或者我需要将其显式安装到 Android 设备?(但据我了解,如果证书是由受信任的 CA 颁发者签名的,那么我不需要安装它,对吗?)

最佳答案

网站does not provide an intermediate certificate这是完成证书链所需的。某些客户端(例如 Android)无法构建完整的证书路径,并且在发生这种情况时不信任该证书。

SSL Labs report showing missing intermediate certificate

如果您是网站管理员,解决此问题的正确方法是发送至 download and supply the intermediate certificate以便发送完整的链。

关于android 不信任证书,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36838470/

相关文章:

java - 自动授予 ACTION_MANAGE_OVERLAY_PERMISSION

android - 如何在 Android Q 中请求删除不属于自己的文件

android - Firebase UI RecyclerView onClick

ruby - Sinatra + HTTPS 重定向到 HTTP?

.net - Delphi 7 中 .NETs NetworkStream/SslStream 的对应物

android - 更改抽屉导航列表文本颜色并添加图标

更新应用程序时Android SQLite数据库更新表

ssl - Drupal 域重定向

java - 如何从 Java 中的 USB token 获取 KeyStore

php - cURL 请求在服务器上工作正常但不会在我的本地主机上工作 :8080