Created
April 26, 2018 09:23
-
-
Save AkshayMoorthy/608564ffc496261ae0caff5e9dc508e2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OkHttpClient.Builder clientBuilder = new OkHttpClient.Builder(); | |
try { | |
clientBuilder.sslSocketFactory(getSSLConfig(context).getSocketFactory()); | |
} | |
catch (Exception e) { | |
e.printStackTrace(); | |
} | |
clientBuilder.hostnameVerifier(new HostnameVerifier() { | |
@Override | |
public boolean verify(String hostname, SSLSession session) { | |
boolean value = true; | |
//TODO:Some logic to verify your host and set value | |
return value; | |
} | |
}); | |
return new Retrofit.Builder().baseUrl(ROOT_URL) | |
.addCallAdapterFactory(RxJava2CallAdapterFactory.create()) | |
.addConverterFactory(GsonConverterFactory.create()) | |
.build(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment