/*
Delegate to the default trust manager.
964548
public void checkClientTrusted(X509Certificate[] chain, String authType)
                 throws CertificateException {
         try {
             pkixTrustManager.checkClientTrusted(chain, authType);
         } catch (CertificateException excep) {
             // do any special handling here, or rethrow exception.
         }
     }
767299
private void registerDefaultDelegationProvider(ComponentContext cc) {
        defaultDelegationProvider = new DefaultDelegationProvider();
        defaultDelegationProvider.setSecurityService(securityServiceRef.getService());
        defaultDelegationProvider.setIdentityStoreHandlerService(identityStoreHandlerServiceRef);
        BundleContext bc = cc.getBundleContext();
        Dictionary<String, Object> props = new Hashtable<String, Object>();
        props.put("type", "defaultProvider");
        defaultDelegationProviderReg = bc.registerService(DelegationProvider.class,
                                                          defaultDelegationProvider,
                                                          props);
    }
841382
protected static List<String> buildDefaultTrustedDirs() {

    List<String> tDirs = new ArrayList<String>();
    tDirs.add(DEFAULT_VOMS_DIR);
    return tDirs;
  }
272300
public static void initInstance(Context context, String meteorServerHostname,
                                    Integer meteorPort, TrustManager[] trustManagers) {
        if (mInstance == null) {
            mInstance = new DDPStateSingleton(context, meteorServerHostname, meteorPort, trustManagers);
        }
    }
197386
@Override
    public void start(final StartContext context) throws StartException {
        AbstractKeyManagerService keyManagers = injectedKeyManagers.getOptionalValue();
        TrustManager[] trustManagers = injectedtrustManagers.getOptionalValue();

        try {
            SSLContext sslContext = SSLContext.getInstance(protocol);
            if(keyManagers != null && keyManagers.isLazy()) {
                sslContext = new LazyInitSSLContext(sslContext, injectedKeyManagers, injectedtrustManagers, enabledCipherSuites, enabledProtocols);
            } else {
                sslContext.init(keyManagers != null ? keyManagers.getKeyManagers() : null, trustManagers, null);
                sslContext = wrapSslContext(sslContext, enabledCipherSuites, enabledProtocols);
            }

            this.theSSLContext = sslContext;

        } catch (NoSuchAlgorithmException e) {
            throw DomainManagementLogger.ROOT_LOGGER.unableToStart(e);
        } catch (KeyManagementException e) {
            throw DomainManagementLogger.ROOT_LOGGER.unableToStart(e);
        }
    }
290354
private static TrustManager createNaiveTrustManager() {
        return new X509TrustManager() {
            public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {
            }

            public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {
            }

            public X509Certificate[] getAcceptedIssuers() {
                return null;
            }
        };
    }
1323430
public static TrustManager[] getTrustManagers(String trustStorePath, String pass)
			throws InitializationException {
			return getTrustManagers(getFileAsInputStream(trustStorePath), pass);
	}
885129
private static void addX509Managers(final Collection<X509TrustManager> managers, KeyStore ks)
			throws KeyStoreException, Error {
		try {
			final TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
			tmf.init(ks);
			for (TrustManager tm : tmf.getTrustManagers()) {
				if (tm instanceof X509TrustManager) {
					managers.add((X509TrustManager) tm);
				}
			}
		} catch (NoSuchAlgorithmException e) {
			throw new Error("Default trust manager algorithm is not supported!", e);
		}
	}
247221
public static TrustManager[] getTrustManagers(Info pathInfo) throws Exception {
        File trustStoreFile = new File(pathInfo.store);
        if (!trustStoreFile.isFile()) {
            throw new Exception("No TrustManager: " + pathInfo.store + " does not exist.");
        }
        String trustStorePassword = pathInfo.password;
        TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
        KeyStore truststore = KeyStore.getInstance("JKS");

        FileInputStream fis = new FileInputStream(pathInfo.store);
        truststore.load(fis, trustStorePassword.toCharArray());
        fis.close();
        tmf.init(truststore);
        return tmf.getTrustManagers();
    }
860883
@Deprecated
    public B withTrustStoreFile(String trustStoreFileName, String trustStorePassword) {
        this.trustStoreFileName = trustStoreFileName;
        this.trustStorePassword = trustStorePassword;
        return self();
    }
822792
private void disableCertificateVerification()
            throws KeyManagementException, NoSuchAlgorithmException {
        // Create a trust manager that does not validate certificate chains
        final TrustManager[] trustAllCerts = new TrustManager[] { new CustomTrustManager() };

        // Install the all-trusting trust manager
        final SSLContext sslContext = SSLContext.getInstance("SSL");
        sslContext.init(null, trustAllCerts, new SecureRandom());
        final SSLSocketFactory sslSocketFactory = sslContext.getSocketFactory();
        HttpsURLConnection.setDefaultSSLSocketFactory(sslSocketFactory);
        final HostnameVerifier verifier = new HostnameVerifier() {
            @Override
            public boolean verify(final String hostname,
                    final SSLSession session) {
                return true;
            }
        };

        HttpsURLConnection.setDefaultHostnameVerifier(verifier);
    }
308466
def trust(self, scope, vk):
        """"""
        self.data['verifiers'].append({'scope': scope, 'vk': vk})
        return self
258116
function getHandlerUntrusted(x) {
			try {
				var untrustedThen = x.then;
				return typeof untrustedThen === 'function'
					? new Thenable(untrustedThen, x)
					: new Fulfilled(x);
			} catch(e) {
				return new Rejected(e);
			}
		}
101080
public void distrust(OpenPgpV4Fingerprint fingerprint)
            throws IOException {
        store.setTrust(getJid(), fingerprint, OpenPgpTrustStore.Trust.untrusted);
    }
115340
public KieServerHttpRequest trustAllCerts() throws KieServerHttpRequestException {
        final HttpURLConnection connection = getConnection();
        if( connection instanceof HttpsURLConnection )
            ((HttpsURLConnection) connection).setSSLSocketFactory(getTrustedFactory());
        return this;
    }
1257463
function() {
        return new Promise(function(resolve, reject) {
            VkSdkLoginManager.authorize(function(error, result) {
                if (error) {
                    reject(error);
                } else {
                    resolve(result);
                }
            });
        });
    }
652171
@SuppressFBWarnings(value = "SIC", justification = "Should not be used in production anyways.")
  public void ignoreCertCheck() throws NoSuchAlgorithmException, KeyManagementException {
    final TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() {
        @Override
        public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {
        }

        @Override
        public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {
        }

        @Override
        public X509Certificate[] getAcceptedIssuers() {
          return new X509Certificate[]{};
        }
      }
    };

    final SSLContext sslContext = SSLContext.getInstance("SSL");
    sslContext.init(null, trustAllCerts, new java.security.SecureRandom());
    final SSLSocketFactory sslSocketFactory = sslContext.getSocketFactory();

    this.httpClient = this.httpClient.newBuilder()
      .sslSocketFactory(sslSocketFactory, (X509TrustManager)trustAllCerts[0])
      .hostnameVerifier(new HostnameVerifier() {
          @Override
          public boolean verify(String hostname, SSLSession session) {
            return true;
          }
        })
      .build();
  }