android - CertificateTransparency:失败:没有证书
问题描述
您好,我使用 okhttp/certificate pinning(使用 TrustKit)实现了这个库( https://github.com/babylonhealth/certificate-transparency-android )问题是我收到了一个错误,即使主机名有日志检查Google 报告 并且有一个使用以下配置的 CT 日志即时消息:
certificateTransparencyInterceptor {
+"*.myhostname.io"
failOnError = false
logger = BasicAndroidCTLogger(BuildConfig.DEBUG)
}
但我从 logcat CertificateTransparency: domain.myhostname.io 失败:没有证书 okHttp 是这样的:
okHttpBuilder.addInterceptor(authInterceptor)
.sslSocketFactory(OkHttp3Helper.getSSLSocketFactory(), OkHttp3Helper.getTrustManager())
.addInterceptor(OkHttp3Helper.getPinningInterceptor())
.addNetworkInterceptor(getCertificateTransparencyInterceptor())
.sslSocketFactory(certificatePinning.getSSLSocketFactory(),
certificatePinning.getTrustManager())
.followRedirects(false)
.followSslRedirects(false)
.build()
我在证书中添加 intereptor.addNetworkInterceptor
被记录google_xenon2021
并且cloudflare_nimbus2021
它们在默认列表中
https://www.gstatic.com/ct/log_list/log_list.json
我试图找出问题所在,但我不知道,
解决方案
目前 CT 库(现在托管在https://github.com/appmattus/certificatetransparency/上)仅支持检索作为 X.509v3 扩展嵌入在证书中的 SCT(签名证书时间戳)。
因此,如果您的域通过 TLS 扩展提供它们,那么该库将无法正常工作。
您应该能够通过在 Web 浏览器中查看证书详细信息并查找嵌入式签名证书时间戳列表条目来进行检查:
推荐阅读
- java - 。之前和之后()
- sql-server-2012 - 加入和日期的性能问题
- java - 使用 Jackson 反转 JSON 漂亮打印
- sql-server - 确定 Azure 移动服务表是否为空的最快客户端方法是什么?
- javascript - javascript - 当字符串以空格字符结尾时,split(" ") 方法在数组的最后一个索引处给出什么?
- android - 如何为firebase数据库子声明字符串值
- python - 将系列索引中的值添加到 Pandas DataFrame 中相等值的行
- sql-server - 是否生成脚本(架构和数据)会影响服务器/数据库的性能
- javascript - 从日期编号创建一系列日期名称?
- jquery - 从 localhost 的第二个窗口登录时,LocalStorage 中的数据会被覆盖