LDAP_OPT_SSL_SECURITY_PROTOCOL
Use LDAP_OPT_SSL_SECURITY_PROTOCOL to
specify a set of one or more protocols to use for secure communication
with an LDAP server.
Supported protocols
The following macros are defined in theldap.h header file to represent the
protocols:#define LDAP_SECURITY_PROTOCOL_ALL "SSLV3,TLS10,TLS11,TLS12,TLS13"
#define LDAP_SECURITY_PROTOCOL_DEFAULT "TLS12,TLS13"
#define LDAP_SECURITY_PROTOCOL_SSLV3 "SSLV3"
#define LDAP_SECURITY_PROTOCOL_TLSV10 "TLS10"
#define LDAP_SECURITY_PROTOCOL_TLSV11 "TLS11"
#define LDAP_SECURITY_PROTOCOL_TLSV12 "TLS12"
#define LDAP_SECURITY_PROTOCOL_TLSV13 "TLS13"You can use the ldap_set_option() API to also set the TLS protocols and ciphers for the TLS protocols. See LDAP_SET_OPTION.
Examples
- Example 1:
- To set all protocols for secure communication with an LDAP server,
use the following example:
ldap_set_option( ld, LDAP_OPT_SSL_SECURITY_PROTOCOL, LDAP_SECURITY_PROTOCOL_ALL);