2011-09-26 112 views
5

環境:Mac OS X的獅子&的Linux Debian的擠壓/ SID,JDK 1.7.0 & JDK 1.6.0_27Java的異常SSLException:主機名的證書不匹配www.googleapis.com

錯誤

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> . 

我在所有上述OS/JDK組合中都收到了這個錯誤。

背景:我正在使用google-api-services-customsearch和google-api-service-shopping jar來對Google進行web服務調用。我的電話正常工作,直到一天前。從昨天開始,該代碼已開始扔...

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) 

我嘗試導入證書到使用the instructions herecacerts密鑰庫,但似乎並沒有解決問題。

回答

相關問題