LDAPAsynConnection::~LDAPAsynConnection(){
DEBUG(LDAP_DEBUG_DESTROY,
"LDAPAsynConnection::~LDAPAsynConnection()" << endl);
- delete m_constr;
unbind();
+ //delete m_constr;
}
void LDAPAsynConnection::init(const string& hostname, int port){
ldap_set_option(cur_session, LDAP_OPT_PROTOCOL_VERSION, &opt);
}
+int LDAPAsynConnection::start_tls(){
+ return ldap_start_tls_s( cur_session, NULL, NULL );
+}
+
LDAPMessageQueue* LDAPAsynConnection::bind(const string& dn,
const string& passwd, const LDAPConstraints *cons){
DEBUG(LDAP_DEBUG_TRACE, "LDAPAsynConnection::bind()" << endl);
virtual ~LDAPAsynConnection();
/**
- * Initzializes a connection to a server.
+ * Initializes a connection to a server.
*
* There actually no
* communication to the server. Just the object is initialized
*/
void init(const string& hostname, int port);
+ /**
+ * Start TLS on this connection. This isn't in the constructor,
+ * because it could fail (i.e. server doesn't have SSL cert, client
+ * api wasn't compiled against OpenSSL, etc.). If you need TLS,
+ * then you should error if this call fails with an error code.
+ */
+ int start_tls();
+
/** Simple authentication to a LDAP-Server
*
* @throws LDAPException If the Request could not be sent to the
LDAPConnection::~LDAPConnection(){
}
+
+int LDAPConnection::start_tls(){
+ return LDAPAsynConnection::start_tls();
+}
void LDAPConnection::bind(const string& dn, const string& passwd,
LDAPConstraints* cons){
*/
void init(const string& hostname, int port);
+ /**
+ * Start TLS on this connection. This isn't in the constructor,
+ * because it could fail (i.e. server doesn't have SSL cert, client
+ * api wasn't compiled against OpenSSL, etc.). If you need TLS,
+ * then you should error if this call fails with an error code.
+ */
+ int start_tls();
+
/**
* Performs a simple authentication with the server
*