I\'m trying to use OkHttp library to send post request to API with some url parameters. Following this blog post I have this code so far:
Apparently you try to connect to a SSL website (https), therefore you need to add a SSLSocketFactory, below little code snippet.
OkHttpClient client = new OkHttpClient();
client.setHostnameVerifier(new HostnameVerifier() {
@Override
public boolean verify(String hostname, SSLSession session) {
return true;
}
});
For more details see this page or this, it should help you.
If you want to "trust all certificates", see this example but it`s not recommanded and should only be used for testing purposes!