Java SSLException:证书中的主机名与www.googleapis.com不匹配 [英] Java SSLException: hostname in certificate didn't match for www.googleapis.com
问题描述
环境:Mac OS X Lion& Linux Debian squeeze / sid,JDK 1.7.0& JDK 1.6.0_27
错误:
javax.net.ssl.SSLException:证书中的主机名不匹配:< www.googleapis.com/74.125.47.95> !=< *。googleapis.com> OR< googleapis.com> OR< *。googleapis.com> 。
在上述所有OS / JDK组合中,我遇到了这个错误。
背景:我正在使用google-api-services-customsearch和google-api-service-jars来对Google进行web服务调用。我的电话正常工作,直到一天前。从昨天开始,代码已经开始抛出......
javax.net.ssl.SSLException:证书中的主机名没有匹配:< 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 keystore中.chrissearle.org / node / 260rel =nofollow>这里的说明,但这似乎并没有解决问题。
方案对于我在 https://stackoverflow.com/a/3904473/419863为我工作这种错误。
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.
For me the solution described in https://stackoverflow.com/a/3904473/419863 worked for me for this kind of error.
这篇关于Java SSLException:证书中的主机名与www.googleapis.com不匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!