Commit 5379d8e3 authored by Tobias Junghans's avatar Tobias Junghans Committed by Sandro Knauß

Use certificate handling code for both SSL and TLS

Summary: The initial certificate handling code has been implemented for TLS only. Since it works for SSL as well and may be required in some scenarious, use the code whenever any security protocol is configured.

Reviewers: mlaurent

Reviewed By: mlaurent

Subscribers: knauss, kde-pim

Tags: #kde_pim

Differential Revision: https://phabricator.kde.org/D28915
parent 8bf94d77
......@@ -279,9 +279,8 @@ int LdapConnection::connect()
}
#endif
//FIXME: accessing to certificate handling would be good
qCDebug(LDAP_LOG) << "setting security to:" << d->mServer.security();
if (d->mServer.security() == LdapServer::TLS) {
if (d->mServer.security() != LdapServer::None) {
bool initContext = false;
if (d->mServer.tlsCACertFile().isEmpty() == false) {
if (setOption(LDAP_OPT_X_TLS_CACERTFILE, d->mServer.tlsCACertFile().toUtf8().data()) != LDAP_OPT_SUCCESS) {
......@@ -328,7 +327,9 @@ int LdapConnection::connect()
return -1;
}
}
}
if (d->mServer.security() == LdapServer::TLS) {
qCDebug(LDAP_LOG) << "start TLS";
#ifdef HAVE_LDAP_START_TLS_S
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment