调用Google Places API时出现SSL证书匹配错误

问题描述:

我一直在我的应用程序中使用Google Places API。客户端代码是用Java编写的。它直到几个星期前,做工精细,突然它开始抛出以下例外情况,同时使API调用:调用Google Places API时出现SSL证书匹配错误

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> 

我使用以下网址制作API调用:https://maps.googleapis.com/maps/api/place/search/json

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

有人可以请点我在这里失踪?

非常感谢

+0

请提供您使用的是执行API请求的代码示例。 – 2012-03-22 22:24:12

+0

我有同样的问题,你解决了吗? – Resh32 2013-02-15 10:56:49

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

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