Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SandroProxy connection to ssl servers; TrustManagers #49

Closed
GoogleCodeExporter opened this issue May 6, 2016 · 2 comments
Closed

SandroProxy connection to ssl servers; TrustManagers #49

GoogleCodeExporter opened this issue May 6, 2016 · 2 comments

Comments

@GoogleCodeExporter
Copy link

TrustManager can be trustAllManager or android OS trustManagers

  private static TrustManager[] _trustAllCerts = new TrustManager[] {
        new X509TrustManager() {
            public X509Certificate[] getAcceptedIssuers() {
                return null;
            }
            public void checkClientTrusted(X509Certificate[] certs, String authType) {
                _logger.fine("trust manager checkClientTrusted authType:" + authType);
                if (certs != null){
                    for (int i = 0; i < certs.length; i++) {
                        _logger.fine("trust manager checkClientTrusted:" + certs[i]);
                    }
                }
            }
            public void checkServerTrusted(X509Certificate[] certs, String authType) {
                _logger.fine("trust manager checkClientTrusted authType:" + authType);
                if (certs != null){
                    for (int i = 0; i < certs.length; i++) {
                        _logger.fine("trust manager checkClientTrusted:" + certs[i]);
                    }
                }
            }
        }
    };

if (!pref.getBoolean(PreferenceUtils.ssTrustAllManager, false)){
    _logger.info("using ssl os trust managers");
    TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
    tmf.init((KeyStore) null);
    trustManagers = tmf.getTrustManagers();
}else{
    _logger.info("warrning: using ssl trust all manager!!!");
}

Original issue reported on code.google.com by supp.san...@gmail.com on 26 Oct 2012 at 1:50

@GoogleCodeExporter
Copy link
Author

Change how to handle unsecure sites with Preferences->Trust all SSL server certs

Original comment by supp.san...@gmail.com on 26 Oct 2012 at 2:12

Attachments:

@GoogleCodeExporter
Copy link
Author

Original comment by supp.san...@gmail.com on 29 Oct 2012 at 6:50

  • Changed state: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant