How to bypass android SSL certificate checking using Retrofit 2.0… here is a solution to the problem.
How to bypass android SSL certificate checking using Retrofit 2.0
I am new to Android programming. So any help would be appreciated:
So I’m working on a new project, and I’m using Retrofit 2.0 beta 2 (Rest Client). So what happened was that the site I used for my web service was not validated and did not have an SSL certificate. Can anyone help me bypass the SSL certificate check.
Solution
This question will be repeated, the following answer worked for me:
https://stackoverflow.com/a/25992879/2096750
Use the following implementation:
OkHttpClient client = getUnsafeOkHttpClient();
Retrofit.Builder builder = new Retrofit.Builder()
.baseUrl(myBaseUrl);
Retrofit retrofit = builder.client(client).build()
...
.
.