Examples of TrustAllTrustManager


Examples of com.google.dataconnector.client.testing.TrustAllTrustManager

      final SSLContext context) throws KeyManagementException {
    if (!localConf.getAllowUnverifiedCertificates()) {
      context.init(null, null, null);
    } else {
      // Use bogus trust all manager
      context.init(null, new TrustManager[] { new TrustAllTrustManager() }, null);
    }
  }
View Full Code Here

Examples of com.google.dataconnector.client.testing.TrustAllTrustManager

      final TrustManagerFactory tmf = TrustManagerFactory.getInstance("PKIX");
      tmf.init(keyStore);
      context.init(null, tmf.getTrustManagers(), null);
    } else {
      // Use bogus trust all manager
      context.init(null, new TrustManager[] { new TrustAllTrustManager() }, null);
    }
  }
View Full Code Here

Examples of com.unboundid.util.ssl.TrustAllTrustManager

      String bindPassword = settings.getString(Keys.realm.ldap.password, "");

      LDAPConnection conn;
      if (ldapUrl.getScheme().equalsIgnoreCase("ldaps")) {
        // SSL
        SSLUtil sslUtil = new SSLUtil(new TrustAllTrustManager());
        conn = new LDAPConnection(sslUtil.createSSLSocketFactory());
        if (ldapPort == -1) {
          ldapPort = 636;
        }
      } else if (ldapUrl.getScheme().equalsIgnoreCase("ldap") || ldapUrl.getScheme().equalsIgnoreCase("ldap+tls")) {
        // no encryption or StartTLS
        conn = new LDAPConnection();
         if (ldapPort == -1) {
           ldapPort = 389;
         }
      } else {
        logger.error("Unsupported LDAP URL scheme: " + ldapUrl.getScheme());
        return null;
      }

      conn.connect(ldapHost, ldapPort);

      if (ldapUrl.getScheme().equalsIgnoreCase("ldap+tls")) {
        SSLUtil sslUtil = new SSLUtil(new TrustAllTrustManager());
        ExtendedResult extendedResult = conn.processExtendedOperation(
            new StartTLSExtendedRequest(sslUtil.createSSLContext()));
        if (extendedResult.getResultCode() != ResultCode.SUCCESS) {
          throw new LDAPException(extendedResult.getResultCode());
        }
View Full Code Here

Examples of com.unboundid.util.ssl.TrustAllTrustManager

      String bindPassword = settings.getString(Keys.realm.ldap.password, "");

      LDAPConnection conn;
      if (ldapUrl.getScheme().equalsIgnoreCase("ldaps")) {
        // SSL
        SSLUtil sslUtil = new SSLUtil(new TrustAllTrustManager());
        conn = new LDAPConnection(sslUtil.createSSLSocketFactory());
        if (ldapPort == -1) {
          ldapPort = 636;
        }
      } else if (ldapUrl.getScheme().equalsIgnoreCase("ldap") || ldapUrl.getScheme().equalsIgnoreCase("ldap+tls")) {
        // no encryption or StartTLS
        conn = new LDAPConnection();
         if (ldapPort == -1) {
           ldapPort = 389;
         }
      } else {
        logger.error("Unsupported LDAP URL scheme: " + ldapUrl.getScheme());
        return null;
      }

      conn.connect(ldapHost, ldapPort);

      if (ldapUrl.getScheme().equalsIgnoreCase("ldap+tls")) {
        SSLUtil sslUtil = new SSLUtil(new TrustAllTrustManager());
        ExtendedResult extendedResult = conn.processExtendedOperation(
            new StartTLSExtendedRequest(sslUtil.createSSLContext()));
        if (extendedResult.getResultCode() != ResultCode.SUCCESS) {
          throw new LDAPException(extendedResult.getResultCode());
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.