1

Running an Android application that use a client keystore against a self-signed certificate, the application runs properly on the emulator (eclipse) but trying to run it on an actual Android device, with 3g connection, fails:

06-16 16:15:28.638: W/System.err(2335): java.io.IOException: Hostname '111.11.11.11' was not verified
06-16 16:15:28.648: W/System.err(2335):     at libcore.net.http.HttpConnection.verifySecureSocketHostname(HttpConnection.java:223)
06-16 16:15:28.648: W/System.err(2335):     at libcore.net.http.HttpsURLConnectionImpl$HttpsEngine.connect(HttpsURLConnectionImpl.java:446)
06-16 16:15:28.658: W/System.err(2335):     at libcore.net.http.HttpEngine.sendSocketRequest(HttpEngine.java:289)
06-16 16:15:28.658: W/System.err(2335):     at libcore.net.http.HttpEngine.sendRequest(HttpEngine.java:239)
06-16 16:15:28.658: W/System.err(2335):     at libcore.net.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:80)
06-16 16:15:28.658: W/System.err(2335):     at libcore.net.http.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:188)
06-16 16:15:28.658: W/System.err(2335):     at libcore.net.http.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:281)
06-16 16:15:28.658: W/System.err(2335):     at org.ksoap2.transport.HttpsServiceConnectionSE.openOutputStream(HttpsServiceConnectionSE.java:124)
06-16 16:15:28.668: W/System.err(2335):     at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:176)
06-16 16:15:28.668: W/System.err(2335):     at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:114)
06-16 16:15:28.668: W/System.err(2335):     at
...

Besides the Internet connection, what other thing should I check to find why it's failing?

Did not find answers on:

Android : java.io.IOException: Hostname was not verified
Android SSL HostName Was Not Verified
java.io.IOException: Hostname was not verified
Hostname was not verified ANDROID

Community
  • 1
  • 1
Rodrick
  • 595
  • 10
  • 27
  • You're making an HTTPS connection with an IP address. Now, SSL certificates are bound to DNS hostnames and since you're not using a DNS hostname to connect, the certificate cannot be verified. – Bloodday Jun 17 '16 at 22:21
  • is the answer for the same question in [Android : java.io.IOException: Hostname was not verified](http://stackoverflow.com/questions/20970428/android-java-io-ioexception-hostname-was-not-verified) – Bloodday Jun 17 '16 at 22:22
  • Why works on the emulator and not on the Android device? – Rodrick Jun 18 '16 at 23:26
  • You should post your code – BNK Jun 18 '16 at 23:37
  • What is the solution? I am facing the same issue – IgorGanapolsky Jun 18 '18 at 19:22
  • I really don't remember what was the solution. I think it was that the server was blocking my IP. – Rodrick Jul 05 '18 at 14:55

0 Answers0