LDAP_OPT_EXT_ERROR

Use the LDAP_OPT_EXT_ERROR setting to return the extended error code.

This setting is a read-only option. For example, if an SSL error occurred when it attempts to call an ldap_search_s API, the actual SSL error can be obtained by using LDAP_OPT_EXT_ERROR:
int error;
ldap_get_option( ld, LDAP_OPT_EXT_ERROR, &exterror);
LDAP_OPT_EXT_ERROR returns errors reported by the SSL library.