0

I have turned off SSL pinning but still I am getting this error. However its working fine on iOS devices. Below is the code I am using

 urlConnection = (HttpsURLConnection) openURLConnection(url.toString(), auth, 5000, 20000, initial);
                urlConnection.setRequestMethod("GET");
                urlConnection.setRequestProperty("Content-length", "0");
                urlConnection.setRequestProperty("Content-Type", "application/json");
                urlConnection.setDoInput(true);

                if (lastUpdateCache != null) {
                    urlConnection.setRequestProperty("If-Modified-Since",
                            "" + ConversionUtils.getDateAsRFC2616String(lastUpdateCache));
                }
  urlConnection.connect();

I am not checking for certificates, even I tried with trusting all certificates but still getting the same issue.

unflagged.destination
  • 1,576
  • 3
  • 19
  • 38
  • Nothing in the code you show is related to TLS at all and thus the code likely does not help to pin down your problem. But this errors comes for example if the server is misconfigured, i.e. serves the wrong certificate or is missing chain certificates. Try [SSLLabs](https://www.ssllabs.com/ssltest/analyze.html) if this is a public server to narrow down the issue. And apart from that: a GET request never has a body which means that the `Content-length` is implicitly 0 (and should not be set) and that `Content-Type` is useless too - since when no content is there it cannot have a type either. – Steffen Ullrich Aug 20 '19 at 06:12
  • @SteffenUllrich Smaller chance, but it could also be the elliptic curve issue of android 7.0 ;) – jobbert Aug 20 '19 at 06:23

0 Answers0