ldap_tls_inplace( LDAP *ld )
{
Sockbuf *sb = NULL;
- int rc;
- rc = ldap_get_option( ld, LDAP_OPT_SOCKBUF, (void *)&sb );
- if ( rc != LDAP_SUCCESS || sb == NULL ) {
+ if ( ld->ld_defconn && ld->ld_defconn->lconn_sb ) {
+ sb = ld->ld_defconn->lconn_sb;
+
+ } else if ( ld->ld_sb ) {
+ sb = ld->ld_sb;
+
+ } else {
return 0;
}
#ifndef HAVE_TLS
return LDAP_NOT_SUPPORTED;
#else
- if ( ld->ld_sb != NULL && ldap_pvt_tls_inplace( ld->ld_sb ) != 0 ) {
+ if ( ldap_tls_inplace( ld ) ) {
return LDAP_LOCAL_ERROR;
}
/* XXYYZ: this initiates operation only on default connection! */
- if ( ld->ld_sb != NULL && ldap_pvt_tls_inplace( ld->ld_sb ) != 0 ) {
+ if ( ldap_tls_inplace( ld ) ) {
return LDAP_LOCAL_ERROR;
}