private void initSSL() throws Exception {  _trustAllCerts = new TrustManager[]{ new X509TrustManager() { public java.security.cert.X509Certificate[] getAcceptedIssuers() { return null; } public void checkClientTrusted(java.security.cert.X509Certificate[] certs, String authType) { } public void checkServerTrusted(java.security.cert.X509Certificate[] certs, String authType) {
static private void initSSL() { String certFile = getClientCertificateFile(); if (certFile != null && !certFile.equals("")) { String keyStorePassword = getKeystorePassword(); if (keyStorePassword != null) { String keyPassword = getKeyPassword(); if (keyPassword == null) { keyPassword = keyStorePassword; } try { loadClientCertificateFromFile(certFile, keyStorePassword, keyPassword); } catch (Exception e) { _logger.severe("Exception loading client cert preferences: " + e);
    private void initSSL() throws Exception {        // Create a trust manager that does not validate certificate chains        _trustAllCerts = new TrustManager[]{            new X509TrustManager() {                public java.security.cert.X509Certificate[] getAcceptedIssuers() {                    return null;                }                public void checkClientTrusted(java.security.cert.X509Certificate[] certs, String authType) {                }                public void checkServerTrusted(java.security.cert.X509Certificate[] certs, String authType) {                }            }        };                // Install the all-trusting trust manager        try {            SSLContext sc = SSLContext.getInstance("SSL");            KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509");            KeyStore ks = KeyStore.getInstance("PKCS12");            ks.load(this.getClass().getResourceAsStream(keystore), keystorepass);            kmf.init(ks, keypassword);            sc.init(kmf.getKeyManagers(), _trustAllCerts, new java.security.SecureRandom());            _factory = (SSLSocketFactory)sc.getSocketFactory();        } catch (Exception e) {            _logger.severe("Error setting up SSL support : " + e);            throw e;        }    }