void *ctx = ld->ld_defconn->lconn_tls_ctx;
char *host;
void *ssl;
- int ret;
if( srv ) {
host = srv->lud_host;
* Fortunately, the lib uses blocking io...
*/
if ( ldap_int_tls_connect( ld, conn ) < 0 ) {
- return LDAP_CONNECT_ERROR;
+ ld->ld_errno = LDAP_CONNECT_ERROR;
+ return (ld->ld_errno);
}
ssl = (void *) ldap_pvt_tls_sb_ctx( sb );
* compare host with name(s) in certificate
*/
- ret = ldap_pvt_tls_check_hostname( ssl, host );
- if (ret != LDAP_SUCCESS)
- return ret;
+ ld->ld_errno = ldap_pvt_tls_check_hostname( ssl, host );
+ if (ld->ld_errno != LDAP_SUCCESS)
+ {
+ return ld->ld_errno;
+ }
/*
* set SASL properties to TLS ssf and authid