Java SSLException:证书中的主机名与 www.googleapis.com 不匹配

发布于 2024-12-06 07:03:30 字数 1184 浏览 0 评论 0 原文

环境:Mac OS X Lion 和 Mac OS X Lion Linux Debian scrape/sid、JDK 1.7.0 和 JDK 1.7.0 JDK 1.6.0_27

错误

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

我在上述所有操作系统/JDK 组合中都遇到此错误。

背景:我正在使用 google-api-services-customsearch 和 google-api-service-shopping jar 来对 Google 进行网络服务调用。直到一天前我的电话都可以正常工作。从昨天开始,代码开始抛出......

javax.net.ssl.SSLException: hostname in certificate didn't match: <www.googleapis.com/74.125.47.95> != <*.googleapis.com> OR <googleapis.com> OR <*.googleapis.com>
    at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:228)
    at org.apache.http.conn.ssl.BrowserCompatHostnameVerifier.verify(BrowserCompatHostnameVerifier.java:54)
.....
    at com.google.api.services.shopping.Shopping$Products$List.execute(Shopping.java:156)

我尝试使用 cacerts 密钥库中“nofollow”>此处的说明,但这似乎并不能解决问题。

Environment: Mac OS X Lion & Linux Debian squeeze/sid, JDK 1.7.0 & JDK 1.6.0_27

Error:

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

I'm getting this error in all the above OS/JDK combinations.

Background: I am using google-api-services-customsearch and google-api-service-shopping jars to do webservice calls to Google. My calls were working correctly until a day ago. Since yesterday, the code has started to throw...

javax.net.ssl.SSLException: hostname in certificate didn't match: <www.googleapis.com/74.125.47.95> != <*.googleapis.com> OR <googleapis.com> OR <*.googleapis.com>
    at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:228)
    at org.apache.http.conn.ssl.BrowserCompatHostnameVerifier.verify(BrowserCompatHostnameVerifier.java:54)
.....
    at com.google.api.services.shopping.Shopping$Products$List.execute(Shopping.java:156)

I tried importing the cert into the cacerts keystore using the instructions here, but that does not seem to solve the problem.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

街道布景 2024-12-13 07:03:30
AsyncHttpClient client = new AsyncHttpClient(true,80,443);
AsyncHttpClient client = new AsyncHttpClient(true,80,443);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文