| | |
| | | import static com.forgerock.opendj.cli.CliMessages.*; |
| | | import static com.forgerock.opendj.cli.CliConstants.DEFAULT_LDAP_PORT; |
| | | import static com.forgerock.opendj.cli.Utils.getHostNameForLdapUrl; |
| | | import static org.forgerock.opendj.ldap.LDAPConnectionFactory.*; |
| | | |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | |
| | | import org.forgerock.opendj.ldap.ConnectionFactory; |
| | | import org.forgerock.opendj.ldap.KeyManagers; |
| | | import org.forgerock.opendj.ldap.LDAPConnectionFactory; |
| | | import org.forgerock.opendj.ldap.LDAPOptions; |
| | | import org.forgerock.opendj.ldap.SSLContextBuilder; |
| | | import org.forgerock.opendj.ldap.TrustManagers; |
| | | import org.forgerock.opendj.ldap.controls.AuthorizationIdentityRequestControl; |
| | |
| | | import org.forgerock.opendj.ldap.requests.GSSAPISASLBindRequest; |
| | | import org.forgerock.opendj.ldap.requests.PlainSASLBindRequest; |
| | | import org.forgerock.opendj.ldap.requests.Requests; |
| | | import org.forgerock.util.Options; |
| | | |
| | | /** |
| | | * A connection factory designed for use with command line tools. |
| | |
| | | e); |
| | | } |
| | | |
| | | LDAPOptions options = new LDAPOptions(); |
| | | Options options = Options.defaultOptions(); |
| | | |
| | | if (sslContext != null) { |
| | | options.setSSLContext(sslContext).setUseStartTLS(useStartTLSArg.isPresent()); |
| | | options.set(SSL_CONTEXT, sslContext) |
| | | .set(USE_STARTTLS, useStartTLSArg.isPresent()); |
| | | } |
| | | options.setConnectTimeout(getConnectTimeout(), TimeUnit.MILLISECONDS); |
| | | options.set(CONNECT_TIMEOUT_IN_MILLISECONDS, |
| | | TimeUnit.MILLISECONDS.toMillis(getConnectTimeout())); |
| | | connFactory = new LDAPConnectionFactory(hostNameArg.getValue(), port, options); |
| | | } |
| | | return connFactory; |