【问题标题】:Handshaked failed when call to AppEngine from Android App从 Android 应用调用 AppEngine 时握手失败
【发布时间】:2020-10-24 18:01:09
【问题描述】:

我是 App Engine 的新手,所以对此有些困惑。 当我将服务部署到 App Engine 时,它​​默认具有 SSL,因为我看到 API 链接具有 https "https://abcdefgh.r.appspot.com/"。我没有在 App Engine 的 SSL 上配置任何东西。

当我构建对该 API 的 Android 应用程序调用时,有些设备可以,但有些不能,我的客户不能,但我的手机可以,所以我无法重现问题,错误是 java.security.cert.CertPathValidatorException

请帮助我如何解决它或以任何方式检查它?为什么它只发生在某些设备上? 我需要在 App Engine 或 Android App 上配置 SSL 吗?

在 Android 上,我使用 Coroutine 和 OkHttp 来发出请求。

非常感谢。

【问题讨论】:

    标签: android api google-app-engine ssl google-cloud-platform


    【解决方案1】:

    您使用的是什么版本的 OkHttp?这里已经有答案 [1] 使用 OkHttp3

    您是否使用自签名证书? Android 不信任自签名证书。

    当证书颁发机构 (CA) 未知时,也可能导致错误 (java.security.cert.CertPathValidatorException)。这里给出了这个错误的详细描述[2]

    关于使用 App Engine(用于自定义域)创建 SSL 证书,您可以使用 Google 管理或自我管理(自定义)证书 [3]

    希望我能帮上忙!

    [1]Use a certificate in an okhttp request with android

    [2]https://developer.android.com/training/articles/security-ssl#java

    [3]https://cloud.google.com/appengine/docs/standard/java11/securing-custom-domains-with-ssl

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-04-25
      • 2016-01-18
      • 2013-03-23
      • 1970-01-01
      • 2016-01-05
      • 2017-06-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多