Skip to content

Instantly share code, notes, and snippets.

@tw-Frey
Created August 26, 2022 04:21
Show Gist options
  • Select an option

  • Save tw-Frey/91ce959fb1a1d11690d871fbcfef9859 to your computer and use it in GitHub Desktop.

Select an option

Save tw-Frey/91ce959fb1a1d11690d871fbcfef9859 to your computer and use it in GitHub Desktop.
Trust Anchor not found for Android SSL Connection

The certificate is not signed by a trusted authority (checking against Mozilla's root store). If you bought the certificate from a trusted authority, you probably just need to install one or more Intermediate certificates. Contact your certificate provider for assistance doing this for your server platform.

Stevie answer in StackOverflow


验证服务器证书时的常见问题 出现这种情况的原因有很多,其中包括:

  1. 颁发服务器证书的 CA 未知
  2. 服务器证书不是 CA 签名的,而是自签名的
  3. 服务器配置缺少中间 CA

https://developer.android.com/training/articles/security-ssl?hl=zh-cn#CommonProblems

缺少中间证书授权机构 可以通过两种方法解决此问题:

  1. 配置服务器以便在服务器链中添加中间 CA。大多数 CA 都可以提供有关如何为所有常用网络服务器执行此操作的文档。如果您需要网站至少通过 Android 4.2 使用默认 Android 浏览器,那么这是唯一的方法。
  2. 或者,像对待其他任何未知 CA 一样对待中间 CA,并创建一个 TrustManager 以直接信任它,如前面两个部分中所述。

https://developer.android.com/training/articles/security-ssl?hl=zh-cn#MissingCa

@tw-Frey
Copy link
Copy Markdown
Author

tw-Frey commented Aug 26, 2022

Support download of intermediate certificates aka AIA Fetching #7052

從中可以知道

  1. On iOS the app is able to download the missing intermediate certificate itself.
  2. OkHttp 預設不會自動下載 中繼 CA,但有提供增強模組 okhttp-tls 去完成這一塊. (待測)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment