【问题标题】:Android certificate transparencyAndroid 证书透明度
【发布时间】:2019-08-15 17:32:10
【问题描述】:

我正在尝试使用 babylon 的 sdk 在 android 应用程序中测试 CT。 我尝试过这里https://github.com/babylonhealth/certificate-transparency-android

但我得到日志 System.out: xxx.xxx.xxx.xxxx.org -> Success: SCT not enabled for insecure connection

我非常确定这些是安全连接,并且我拥有有效的 SCT。 当我深入研究代码时,我可以看到`

val host = chain.request().url().host()
        val certs = chain.connection()?.handshake()?.peerCertificates()?.map { it as X509Certificate } ?: emptyList()

        val result = if (chain.connection()?.socket() is SSLSocket) {
            verifyCertificateTransparency(host, certs)
        } else {
            VerificationResult.Success.InsecureConnection(host)
        }`

它来到 else 部分并因此给出错误。我看到连接具有空值。知道可能出了什么问题。

【问题讨论】:

    标签: android certificate-transparency


    【解决方案1】:

    如果不知道所使用的完整 URL,就很难知道您遇到了什么问题。代码“应该”仅在不安全的连接(即 http 而不是 https)时到达 else

    该库确实有一个日志机制,可以帮助调试问题。创建okhttp拦截器时,设置logger = BasicAndroidCRLogger(BuildConfig.DEBUG)

    【讨论】:

      猜你喜欢
      • 2017-03-09
      • 2021-01-20
      • 2018-11-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-01-22
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多