Skip to content

Instantly share code, notes, and snippets.

@AkshayMoorthy
Created April 26, 2018 09:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AkshayMoorthy/608564ffc496261ae0caff5e9dc508e2 to your computer and use it in GitHub Desktop.
Save AkshayMoorthy/608564ffc496261ae0caff5e9dc508e2 to your computer and use it in GitHub Desktop.
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