一、异常日志
javax.net.ssl.SSLHandshakeException:
Caused by: java.security.cert.CertificateException: No subject alternative names present
at sun.security.util.HostnameChecker.matchIP(Unknown Source)
at sun.security.util.HostnameChecker.match(Unknown Source)
at sun.security.ssl.X509TrustManagerImpl.checkIdentity(Unknown Source)
at sun.security.ssl.X509TrustManagerImpl.checkIdentity(Unknown Source)
at sun.security.ssl.X509TrustManagerImpl.checkTrusted(Unknown Source)
at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source)
... 12 more
二、问题代码
public class SslHandshakeExc_NsanPresent{
public static void main(String[] args) throws Exception {
URL url = new URL("https://192.168.2.222:8443/wbsystem/login.jsp");
HttpsURLConnection conn = (HttpsURLConnection) url.openConnection();