【问题标题】:Android app rejected google play because of Vulnerability issue由于漏洞问题,Android 应用程序拒绝了 google play
【发布时间】:2016-06-16 19:31:53
【问题描述】:

在将应用程序上传到游戏市场后得到此说明: “要正确处理 SSL 证书验证,请更改自定义 X509TrustManager 接口的 checkServerTrusted 方法中的代码,以在服务器提供的证书不符合您的期望时引发 CertificateException 或 IllegalArgumentException。”怎么会这样,请帮忙。

我的代码是:enter image description here

【问题讨论】:

标签: android ssl


【解决方案1】:

使用切换到简单的心情 然后刷新页面并再次尝试上传APK。 In google play developer console

【讨论】:

    【解决方案2】:
    I also had SSLCertification issue at the time uploading singed apk.
    you have to return true for all your trusted http hosts including 3rd party libraries http.
    

    我在这里说明我是如何解决这个问题的,对不起,我没有放链接的原始路径,这些 Link 帮助我

            TrustManager[] trustAllCerts = new TrustManager[]{new X509TrustManager() {
                public X509Certificate[] getAcceptedIssuers() {
                    X509Certificate[] myTrustedAnchors = new X509Certificate[0];
                    return myTrustedAnchors;
                }
    
                @Override
                public void checkClientTrusted(X509Certificate[] certs, String authType) {
                }
    
                @Override
                public void checkServerTrusted(X509Certificate[] certs, String authType) {
                }
            }};
    
    
        SSLContext sc = SSLContext.getInstance("SSL");
        sc.init(null, trustAllCerts, new SecureRandom());
        HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
        HttpsURLConnection.setDefaultHostnameVerifier(new HostnameVerifier() {
            @Override
            public boolean verify(String hostname, SSLSession arg1) {
                if (hostname.equalsIgnoreCase("demo.mysite.com") ||
                        hostname.equalsIgnoreCase("prod.mysite.com") ||
                        hostname.equalsIgnoreCase("22.2.202.22:3333") ||
                        hostname.equalsIgnoreCase("cloud.cloudDeveSite.net") ||                            
                        hostname.equalsIgnoreCase("11.2.222.22:2222") ||
                        hostname.equalsIgnoreCase("multispidr.3rdPartyLibrary.io")) {
                    return true;
                } else {
                    return false;
                }
            }
        });
    

    提到所有有 SSLCertification 问题的 api,你还必须提到 3rd 方 api,当你运行该代码时,你会得到那些错误的 HTTP 链接。

    【讨论】:

      猜你喜欢
      • 2016-02-09
      • 1970-01-01
      • 1970-01-01
      • 2022-12-17
      • 2022-06-16
      • 2021-09-06
      • 1970-01-01
      • 2019-04-06
      • 2020-08-03
      相关资源
      最近更新 更多