Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/192.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ssl/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
HostNameVerifier游戏商店Android_Android_Ssl_Ssl Certificate_Android Volley_Android Security - Fatal编程技术网

HostNameVerifier游戏商店Android

HostNameVerifier游戏商店Android,android,ssl,ssl-certificate,android-volley,android-security,Android,Ssl,Ssl Certificate,Android Volley,Android Security,我提交应用程序时遇到问题。 我已经做了如下的截击设置,但游戏商店显示拒绝 主机名验证程序 您的应用程序正在使用HostnameVerifier接口的不安全实现。你可以在这篇谷歌帮助中心的文章中找到更多关于如何解决这个问题的信息 RequestQueue queue = Volley.newRequestQueue(Services.this, new HurlStack(null, newSslSocketFactory())); // Request a string

我提交应用程序时遇到问题。 我已经做了如下的截击设置,但游戏商店显示拒绝

主机名验证程序

您的应用程序正在使用HostnameVerifier接口的不安全实现。你可以在这篇谷歌帮助中心的文章中找到更多关于如何解决这个问题的信息

    RequestQueue queue = Volley.newRequestQueue(Services.this, new HurlStack(null, newSslSocketFactory()));
        // Request a string response from the provided URL.

        try {
            final ProgressDialog pDialog = new ProgressDialog(Services.this);
            pDialog.setMessage("Wainting ...");
            pDialog.show();

            String url = "https://sitesecurity.com";
                 StringRequest stringRequest = new StringRequest(Request.Method.POST, url, new Response.Listener<String>(){
                @Override
                public void onResponse(String response) {
}



     private SSLSocketFactory newSslSocketFactory() {
            try {
                HttpsURLConnection.setDefaultHostnameVerifier(new HttpsTrustManager());
                SSLContext context = SSLContext.getInstance("TLS");
                context.init(null, new X509TrustManager[]{new DadosConsultaPerto.NullX509TrustManager()}, new SecureRandom());
                HttpsURLConnection.setDefaultSSLSocketFactory(context.getSocketFactory());
                SSLSocketFactory sf = context.getSocketFactory();
                return sf;
            } catch (Exception e) {
                throw new AssertionError(e);
            }
        }
RequestQueue queue=Volley.newRequestQueue(Services.this,newhurlstack(null,newsslssocketfactory());
//从提供的URL请求字符串响应。
试一试{
final ProgressDialog pDialog=新建ProgressDialog(Services.this);
pDialog.setMessage(“哭泣…”);
pDialog.show();
字符串url=”https://sitesecurity.com";
StringRequest StringRequest=new StringRequest(Request.Method.POST,url,new Response.Listener()){
@凌驾
公共void onResponse(字符串响应){
}
私有SSLSocketFactory新闻SSLSocketFactory(){
试一试{
HttpsURLConnection.setDefaultHostnameVerifier(新的HttpsTrustManager());
SSLContext context=SSLContext.getInstance(“TLS”);
init(null,新的X509TrustManager[]{new-DadosConsultaPerto.NullX509TrustManager()},新的SecureRandom());
HttpsURLConnection.setDefaultSSLSocketFactory(context.getSocketFactory());
SSLSocketFactory sf=context.getSocketFactory();
返回sf;
}捕获(例外e){
抛出新断言错误(e);
}
}
我尝试了几种方法,但错误仍然存在

漏洞APK版本超过到期日期 主机名验证程序

您的应用程序正在使用HostnameVerifier接口的不安全实现。您可以在本Google帮助中心文章中找到有关如何解决此问题的更多信息。
2017年3月1日5日

删除
newsssocketfactory()
,并停止在
hurstack
构造函数调用中引用它。这就是以完全不安全的方式使用
主机名验证程序的地方


我猜你的
HttpsTrustManager
是,这也是完全不安全的,会导致你的应用被禁止进入Play Store。删除
newsslssocketfactory()
也会解决这个问题。

首先选择apk版本并在警报中(启动前报告),选择安全性和信任,在详细信息中,您将找到受影响的类。

那么您是否查看了Google帮助中心关于
HostnameVerifier
的文章,以及您到底做了什么?我是按照Google的指示做的。我没有客户端证书,因为Web服务获得了共享证书。'public boolean verify(String hostname,SSLSession session){Log.i(“RestUtilImpl”,“批准“+hostname”的证书);返回true;}'我希望这个问题在过去3年内得到了解决。您能分享一下解决方案吗?我按照他的建议做了,他仍然拒绝。