原文:JDK安全證書的一個錯誤消息 No subject alternative names present的解決辦法

我使用Java消費某網站一個Restful API時,遇到這個錯誤: : : . main DEBUG org.springframework.web.client.RestTemplate Created GET request for https: . . . : commerce product : : . main DEBUG org.springframework.web.client. ...

2019-12-14 08:53 0 1089 推薦指數:

查看詳情

java.security.cert.CertificateException: No subject alternative names present

背景:在開發一個項目中,要調用一個webservice服務,之前設置的是http協議,項目中采用jdk自帶的wsimport工具生成的客戶端代碼; 后來,需求變更要求兼容https協議的webservice,開始以為只需要簡單的將服務地址的連接改為https就可以了;但不行,總是報錯 ...

Fri Oct 30 03:19:00 CST 2015 0 16713
自簽證書 doesn't match any of the subject alternative names

出現這個的原因是https中的域名或者IP,與證書中登記的不一致。 如果是自簽證書的話,可以根據具體需要重新生成證書。 還有一種解決方案是在java中跳過這個檢查。 繞過檢查分兩類,一個是繞過證書在CA備案的檢查,一個是繞過url和證書中記錄IP或域名的檢查 未完待續。。。 ...

Thu Dec 27 00:03:00 CST 2018 0 1965
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM