PresetLDAPConnectionFactory
public class LDAPConnectionFactory extends Object
Constructor | Description |
---|---|
LDAPConnectionFactory(CustomTrustStoreConfiguration customTrustStore,
CustomKeyStoreConfiguration customKeyStore) |
Creates a new LDAP connection factory.
|
Modifier and Type | Method | Description |
---|---|---|
com.unboundid.ldap.sdk.LDAPConnection |
createLDAPConnection(com.unboundid.ldap.sdk.ServerSet ldapServerSet,
LDAPConnectionSecurity security,
boolean trustSelfSignedCerts) |
Creates a new LDAP connection to the specified directory server set.
|
com.unboundid.ldap.sdk.LDAPConnection |
createLDAPConnection(String host,
int port,
LDAPConnectionSecurity security,
int timeout,
boolean trustSelfSignedCerts) |
Creates a new LDAP connection to the specified directory server.
|
CustomKeyStoreConfiguration |
getCustomKeyStoreConfiguration() |
Gets the custom key store configuration.
|
CustomTrustStoreConfiguration |
getCustomTrustStoreConfiguration() |
Gets the custom trust store configuration.
|
static SocketFactory |
getSocketFactory(LDAPConnectionSecurity security,
CustomTrustStoreConfiguration customTrustStore,
CustomKeyStoreConfiguration customKeyStore,
boolean trustSelfSignedCerts) |
Creates a new socket factory according to the specified LDAP
connection security settings.
|
static com.unboundid.util.ssl.SSLUtil |
initSecureConnectionContext(CustomTrustStoreConfiguration customTrustStore,
CustomKeyStoreConfiguration customKeyStore,
boolean trustSelfSignedCerts) |
Initialises the context for a secure LDAP connection by creating the
required TLS/SSL trust and key managers.
|
public LDAPConnectionFactory(CustomTrustStoreConfiguration customTrustStore, CustomKeyStoreConfiguration customKeyStore)
customTrustStore
- The custom trust store configuration. Must
not be null
.customKeyStore
- The custom key store configuration. Must not
be null
.public CustomTrustStoreConfiguration getCustomTrustStoreConfiguration()
public CustomKeyStoreConfiguration getCustomKeyStoreConfiguration()
public static com.unboundid.util.ssl.SSLUtil initSecureConnectionContext(CustomTrustStoreConfiguration customTrustStore, CustomKeyStoreConfiguration customKeyStore, boolean trustSelfSignedCerts) throws KeyStoreException
customTrustStore
- The custom trust store configuration.
Must not be null
.customKeyStore
- The custom key store configuration. Must
not be null
.trustSelfSignedCerts
- The trust policy for self-signed X.509
certificates presented by the LDAP
server.KeyStoreException
- On a client key store exception.public static SocketFactory getSocketFactory(LDAPConnectionSecurity security, CustomTrustStoreConfiguration customTrustStore, CustomKeyStoreConfiguration customKeyStore, boolean trustSelfSignedCerts) throws LDAPConnectionException
security
- The requested LDAP connection security.
Must not be null
.customTrustStore
- The custom trust store configuration.
Must not be null
.customKeyStore
- The custom key store configuration. Must
not be null
.trustSelfSignedCerts
- The trust policy for self-signed X.509
certificates presented by the LDAP
server.null
for a plain
connection.LDAPConnectionException
- On a failure to create an SSL socket
factory.public com.unboundid.ldap.sdk.LDAPConnection createLDAPConnection(String host, int port, LDAPConnectionSecurity security, int timeout, boolean trustSelfSignedCerts) throws LDAPConnectionException
host
- The LDAP server host name / IP address.
Must not be null
.port
- The LDAP server port.security
- The LDAP connection security. Must not
be null
.timeout
- The timeout in milliseconds for LDAP
connect requests. If zero the underlying
LDAP client library will determine this
value.trustSelfSignedCerts
- The trust policy for self-signed X.509
certificates presented by the LDAP
server.LDAPConnectionException
- If a new LDAP connection could not
be created.public com.unboundid.ldap.sdk.LDAPConnection createLDAPConnection(com.unboundid.ldap.sdk.ServerSet ldapServerSet, LDAPConnectionSecurity security, boolean trustSelfSignedCerts) throws LDAPConnectionException
ldapServerSet
- The LDAP server set. Must not be
null
.security
- The LDAP connection security. Must not
be null
.trustSelfSignedCerts
- The trust policy for self-signed X.509
certificates presented by the LDAP
server.LDAPConnectionException
- If a new LDAP connection could not
be created.Copyright © 2018 Connect2id. All rights reserved.