ClassCastException tells you that the returned object is not an HttpsUrlConnection. The cast you are doing is inherently unsafe, instead you need something like:
URLConnection conn = new URL(url).openConnection(); if (conn instanceof HttpsURLConnection) { // do stuff } else { // error? }
Due to the fact that it does not give you the Https version, what url do you provide? I assume that you give it http: .. instead of https: ...
Cheryl Simon
source share