Google Play Security Alert - Your app is using an unsafe implementation of the HostnameVerifier

后端 未结 5 1634
庸人自扰
庸人自扰 2020-11-30 12:34

Recently one of my app got a security alert from Google Play as below.

You app is using an unsafe implementation of the HostnameVerifier. And refer a link to Google

5条回答
  •  伪装坚强ぢ
    2020-11-30 13:24

    HttpsURLConnection.setDefaultHostnameVerifier(new HostnameVerifier()
        {
            @Override
            public boolean verify(String hostname,SSLSession arg1)
            {
                if (! hostname.equalsIgnoreCase("www.asdasdad.com"))
                    return true;
                else
                    return false;
            }
        });
    

    It works

提交回复
热议问题