ber_int_t ldo_sizelimit;
#ifdef HAVE_TLS
+ /* tls context */
+ void *ldo_tls_ctx;
int ldo_tls_mode;
LDAP_TLS_CONNECT_CB *ldo_tls_connect_cb;
void* ldo_tls_connect_arg;
*/
typedef struct ldap_conn {
Sockbuf *lconn_sb;
-#ifdef HAVE_TLS
- /* tls context */
- void *lconn_tls_ctx;
-#endif
#ifdef HAVE_CYRUS_SASL
void *lconn_sasl_authctx; /* context for bind */
void *lconn_sasl_sockctx; /* for security layer */
} else {
struct ldapoptions *lo;
- void *ctx = ld->ld_defconn
- ? ld->ld_defconn->lconn_tls_ctx : NULL;
+ void *ctx;
+
+ lo = &ld->ld_options;
+ ctx = lo->ldo_tls_ctx;
ssl = alloc_handle( ctx );
if( ctx == NULL ) {
ctx = tls_def_ctx;
- conn->lconn_tls_ctx = tls_def_ctx;
+ lo->ldo_tls_ctx = ctx;
}
- lo = &ld->ld_options;
if ( lo->ldo_tls_connect_cb )
lo->ldo_tls_connect_cb( ld, ssl, ctx, lo->ldo_tls_connect_arg );
lo = LDAP_INT_GLOBAL_OPT();
if ( ld == NULL ) {
*(void **)arg = (void *) tls_def_ctx;
} else {
- *(void **)arg = ld->ld_defconn->lconn_tls_ctx;
+ *(void **)arg = lo->ldo_tls_ctx;
}
break;
case LDAP_OPT_X_TLS_CACERTFILE:
tls_def_ctx = (SSL_CTX *) arg;
} else {
- ld->ld_defconn->lconn_tls_ctx = arg;
+ lo->ldo_tls_ctx = arg;
}
return 0;
case LDAP_OPT_X_TLS_CONNECT_CB: