5

I'm occasionally getting this error when making volley requests. It's strange because it will sometimes work and sometimes not work.

com.android.volley.NoConnectionError: java.io.IOException: Hostname '--url--' was not verified

According to this: http://developer.android.com/training/articles/security-ssl.html it has to do with hostname verification but my API call ALWAYS works on a browser and like I mentioned earlier, sometimes works on Android via Volley.

Has anyone experienced this before?

I've seen similar issues mentioned here, but none relating to Volley. They all basically point to using a NullHostNameVerifier (java.io.IOException: Hostname was not verified), which I don't know if it can be done on Volley...

Community
  • 1
  • 1
The Hungry Androider
  • 2,274
  • 5
  • 27
  • 52

2 Answers2

0

I was getting this same error. In my case, all of my http requests would work correctly for a bit and then I would get the "java.io.IOException: Hostname was not verified" exception no matter what I did until I restarted the app.

Turns out that the system clock on my Android device was off by about 2 minutes, which caused the SSL verification to fail.

Once I adjusted the time on my Android device, the exception no longer occurred.

dreyln
  • 860
  • 1
  • 9
  • 18
0

This answer might help someone. Make sure that API key for the android client exists on console.developers.google.com. Also, add all the necessary lib files in the projects lib folder and generated client files in the appspot folder.

  • I'm having the same error. Could you please specify more about this API key? where should i put it in the Android project? – voghDev Aug 12 '14 at 10:12
  • Check the network connection on your phone/emulator. If you are facing setup related issued then, this link might help you http://rominirani.com/2014/01/16/google-cloud-endpoints-tutorial-part-3/ – user3594535 Aug 12 '14 at 16:25
  • It was related to SSL. Solved it by a "trusting all SSL entities" solution – voghDev Aug 13 '14 at 08:25