【问题标题】:SSL Certificate Match Error while calling Google Places API调用 Google Places API 时出现 SSL 证书匹配错误
【发布时间】:2013-02-15 20:13:56
【问题描述】:

我一直在我的应用程序中使用 Google Places API。客户端代码是用 Java 编写的。几周前它工作正常,突然在调用 API 时开始抛出以下异常:

javax.net.ssl.SSLException: hostname in certificate didn't match: <maps.googleapis.com/209.85.175.95> != <*.googleapis.com> OR <googleapis.com> OR <*.googleapis.com>

我正在使用以下 URL 进行 API 调用:https://maps.googleapis.com/maps/api/place/search/json?

还尝试使用从 Google API 控制台生成的不同 Google API 密钥。

有人可以指出我在这里缺少什么吗?

非常感谢

【问题讨论】:

  • 请提供您用于执行 API 请求的代码示例。
  • 我也遇到了同样的问题,你解决了吗?

标签: google-places-api


【解决方案1】:

我使用了支持更好 SSL 选项的最新 Google API(版本 1.13.2):

ApacheHttpTransport.Builder transport = new ApacheHttpTransport.Builder().doNotValidateCertificate().build();

【讨论】:

    猜你喜欢
    • 2018-01-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-01-10
    • 2021-09-13
    • 2023-04-11
    • 2021-11-17
    • 1970-01-01
    相关资源
    最近更新 更多