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

后端 未结 5 1646
庸人自扰
庸人自扰 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:17

    HttpsURLConnection.setDefaultHostnameVerifier(new HostnameVerifier(){ 
        public boolean verify(String arg0, SSLSession arg1) {
            return true;
    }}); 
    

    This code effectively removes the protection of HTTPS from your connections. You need to delete it.

    Disabling hostname verification allows anyone on the network to view and tamper with your network traffic by conducting a Man In The Middle Attack.

提交回复
热议问题