I have a HttpsURLConnection class written in core Java that I've recently ported to Android. Interestingly enough though, it works just fine... the first time. On the second time, even if I use the same class, and even if I create a separate instance of it, the connection is never made and getResponseCode() is -1.
Since my class is kinda complex, I tried it with the "solution" I found here: viewtopic.php?p=26514 but I break out the try/catch into a function so I can call it twice. Even then, it only works the first time.
I've been trying different permutations and examples found online (with and without fake certificates) that supposedly work, but all with the same results.
Everything I've tried work perfectly with HttpURLConnection and http:// but when I move it over to https:// and HttpsURLConnection, it only works once per app launch.
Anyone have any ideas? I'm sufficiently frustrated after days of this.
Thanks in advance