主机名未通过验证ANDROID

主机名未通过验证ANDROID,第1张

概述我正在使用kso​​aplib调用webservice.在某些情况下,服务运行正常,但在某些情况下,它给出的主机名未通过验证以下是我用于调用网络服务的代码.HttpTransportSEhttpTransport=newHttpTransportSE(URL,MessageConstant.TIMEOUT_TIME);httpTransport.debug=

我正在使用kso​​ap lib调用webservice.在某些情况下,服务运行正常,但在某些情况下,它给出的主机名未通过验证
以下是我用于调用网络服务的代码.

 httpTransportSE httpTransport = new httpTransportSE(URL, MessageConstant.TIMEOUT_TIME);            httpTransport.deBUG = true; // this is optional, use it if you don't want to use a packet sniffer to check what the sent message was (httpTransport.requestDump)            httpTransport.call(SOAP_ACTION, envelope); // send request

这是我的原木猫

java.io.IOException: Hostname 'XXX.XX.XXX.XXX' was not verifIEdat libcore.net.http.httpconnection.verifySecureSocketHostname(httpconnection.java:223)at libcore.net.http.httpsURLConnectionImpl$httpsEngine.connect(httpsURLConnectionImpl.java:446)at libcore.net.http.httpEngine.sendSocketRequest(httpEngine.java:289)at libcore.net.http.httpEngine.sendRequest(httpEngine.java:239)at libcore.net.http.httpURLConnectionImpl.connect(httpURLConnectionImpl.java:80)at libcore.net.http.httpsURLConnectionImpl.connect(httpsURLConnectionImpl.java:165)at org.ksoap2.transport.ServiceConnectionSE.connect(ServiceConnectionSE.java:76)at org.ksoap2.transport.httpTransportSE.call(httpTransportSE.java:152)at org.ksoap2.transport.httpTransportSE.call(httpTransportSE.java:95)

解决方法:

该链接可能有多种原因.没有一个响应被标记为“已接受”:

> java.io.IOException: Hostname was not verified

您还应该在这里查看:

07001

One reason this can happen is due to a server configuration error. The
server is configured with a certificate that does not have a subject
or subject alternative name fIElds that match the server you are
trying to reach. It is possible to have one certificate be used with
many different servers.

For example, looking at the Google.com
certificate with openssl s_clIEnt -connect Google.com:443 | openssl
x509 -text
you can see that a subject that supports *.Google.com but
also subject alternative names for *.youtube.com, *.androID.com, and
others. The error occurs only when the server name you are connecting
to isn’t Listed by the certificate as acceptable.

总结

以上是内存溢出为你收集整理的主机名未通过验证ANDROID全部内容,希望文章能够帮你解决主机名未通过验证ANDROID所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1093509.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-28
下一篇 2022-05-28

发表评论

登录后才能评论

评论列表(0条)

保存