I developed the app and published the google play store then received the notification from Google
HostnameVerifier Your app(s) are using an unsafe implementation of the HostnameVerifier interface. You can find more information about how to resolve the issue in this Google Help Center article, including the deadline for fixing the vulnerability.
I can't use HostnameVerifier or call setDefaultHostnameVerifier()
, I assume it relies upon some 3rd party lib. Third parties lib used- Google map, baidu map, firebase crash analytics, firebase phone authentication, quick blox, mob authentication
.
I tried to use these code in splash to solve this issue-
HostnameVerifier hostnameVerifier = org.apache.http.conn.ssl.SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER;
DefaultHttpClient client = new DefaultHttpClient();
SchemeRegistry registry = new SchemeRegistry();
SSLSocketFactory socketFactory = SSLSocketFactory.getSocketFactory();
socketFactory.setHostnameVerifier((X509HostnameVerifier) hostnameVerifier);
registry.register(new Scheme("https", socketFactory, 443));
SingleClientConnManager mgr = new SingleClientConnManager(client.getParams(), registry);
DefaultHttpClient httpClient = new DefaultHttpClient(mgr, client.getParams());
HttpsURLConnection.setDefaultHostnameVerifier(hostnameVerifier);
And
HttpsURLConnection.setDefaultHostnameVerifier(new HostnameVerifier() {
public boolean verify(final String hostname, final SSLSession session) {
if (session.isValid()) {
return true;
}
else
{
return false;
}`
But, my app got rejected from Google play store.
Please, help me in finding whats wrong with this code? and how to solve it?