// $OpenLDAP$
/*
- * Copyright 2010, OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 2010-2011 The OpenLDAP Foundation, All Rights Reserved.
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
*/
}
}
+TlsOptions::TlsOptions() : m_ld(NULL) {}
+
TlsOptions::TlsOptions( LDAP* ld ): m_ld(ld) { }
void TlsOptions::setOption( tls_option opt, const std::string& value ) const {
throw( LDAPException( LDAP_PARAM_ERROR, "error while setting TLS option" ) );
}
}
- if ( m_ld ){
- this->newCtx();
- }
+ this->newCtx();
}
void TlsOptions::getOption( tls_option opt, void* value ) const {
}
void TlsOptions::newCtx() const {
- int ret = ldap_set_option( m_ld, LDAP_OPT_X_TLS_NEWCTX, LDAP_OPT_ON);
+ int val = 0;
+ int ret = ldap_set_option( m_ld, LDAP_OPT_X_TLS_NEWCTX, &val);
if ( ret != LDAP_OPT_SUCCESS )
{
if ( ret != LDAP_OPT_ERROR ){