NutzCN Logo
问答 http.get 异常
发布于 800天前 作者 tiankongkm 527 次浏览 复制 上一个帖子 下一个帖子
标签:

请问大佬这个该怎么办~~~
Exception in thread "main" org.nutz.http.HttpException: url=https://120.25.135.13/rents_bycate
at org.nutz.http.sender.GetSender.send(GetSender.java:22)
at org.nutz.http.Http.get(Http.java:143)
at com.tiankong.Test.test(Test.java:31)
at com.tiankong.Test.main(Test.java:26)
Caused by: javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: No subject alternative names matching IP address 120.25.135.13 found
at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1904)
at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:279)
at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:273)
at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1446)
at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:209)
at sun.security.ssl.Handshaker.processLoop(Handshaker.java:901)
at sun.security.ssl.Handshaker.process_record(Handshaker.java:837)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1023)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1332)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1359)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1343)
at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:563)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1301)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:468)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:338)
at org.nutz.http.Sender.getResponseHeader(Sender.java:143)
at org.nutz.http.sender.GetSender.send(GetSender.java:19)
... 3 more
Caused by: java.security.cert.CertificateException: No subject alternative names matching IP address 120.25.135.13 found
at sun.security.util.HostnameChecker.matchIP(HostnameChecker.java:154)
at sun.security.util.HostnameChecker.match(HostnameChecker.java:91)
at sun.security.ssl.X509TrustManagerImpl.checkIdentity(X509TrustManagerImpl.java:347)
at sun.security.ssl.AbstractTrustManagerWrapper.checkAdditionalTrust(SSLContextImpl.java:919)
at sun.security.ssl.AbstractTrustManagerWrapper.checkServerTrusted(SSLContextImpl.java:886)
at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1428)
... 17 more

7 回复

有域名么

@Rekoe 游览器可以直接访问 但是http.get 不行

那就别用https 没有任何意义 https 用ip的话

Http.disableJvmxxx

@wendal 加上Http.disableJvmHttpsCheck(); 这个不管用0.0

那就没办法了,https走ip可是歪门邪道,哈哈

添加回复
请先登陆
回到顶部