View | Details | Raw Unified | Return to bug 41352
Collapse All | Expand All

(-)ldap/apr_ldap_option.c (+18 lines)
Lines 531-536 Link Here
531
    /* OpenLDAP SDK */
531
    /* OpenLDAP SDK */
532
#if APR_HAS_OPENLDAP_LDAPSDK
532
#if APR_HAS_OPENLDAP_LDAPSDK
533
#ifdef LDAP_OPT_X_TLS_CACERTFILE
533
#ifdef LDAP_OPT_X_TLS_CACERTFILE
534
#ifndef LDAP_OPT_X_TLS_NEWCTX 
535
    if (ldap) {
536
        result->reason = "LDAP: The OpenLDAP SDK cannot support the setting "
537
                         "of certificates or keys on a per connection basis.";
538
        result->rc = -1;
539
        return; 
540
    }
541
#endif
542
534
    /* set one or more certificates */
543
    /* set one or more certificates */
535
    /* FIXME: make it support setting directories as well as files */
544
    /* FIXME: make it support setting directories as well as files */
536
    for (i = 0; i < certs->nelts; i++) {
545
    for (i = 0; i < certs->nelts; i++) {
Lines 561-566 Link Here
561
            break;
570
            break;
562
        }
571
        }
563
    }
572
    }
573
    /*  Certificate settings are now configured, but we also need a new
574
     *  TLS context to be created.
575
     */
576
    if (ldap && (result->rc == LDAP_SUCCESS)) {
577
        int IS_SERVER = 0;
578
        result->rc = ldap_set_option(ldap, LDAP_OPT_X_TLS_NEWCTX, &IS_SERVER);
579
        result->msg = ldap_err2string(result->rc);
580
    }
581
564
#else
582
#else
565
    result->reason = "LDAP: LDAP_OPT_X_TLS_CACERTFILE not "
583
    result->reason = "LDAP: LDAP_OPT_X_TLS_CACERTFILE not "
566
                     "defined by this OpenLDAP SDK. Certificate "
584
                     "defined by this OpenLDAP SDK. Certificate "

Return to bug 41352