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:
Check SSLSession hostname and your connection host name...
OkHttpClient client = new OkHttpClient();
client.setHostnameVerifier(new HostnameVerifier() {
@Override
public boolean verify(String hostname, SSLSession session) {
if (!urlHostName.equalsIgnoreCase(session.getPeerHost())) {
System.out.println("Warning: URL host '" + urlHostName
+ "' is different to SSLSession host '"
+ session.getPeerHost() + "'.");
}
return true;
}
});