1

我一直在我的应用程序中使用 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 密钥。

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

非常感谢

4

1 回答 1

1

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

ApacheHttpTransport.Builder transport = new ApacheHttpTransport.Builder().doNotValidateCertificate().build();
于 2013-02-15T12:13:56.050 回答