Blame SOURCES/0001-ldap-setup-TLS-when-using-ldaps.patch

3eb28c
From e41de8344a09092ae4d973f495eef54a106a11ee Mon Sep 17 00:00:00 2001
3eb28c
From: Sumit Bose <sbose@redhat.com>
3eb28c
Date: Thu, 26 Nov 2020 17:24:10 +0100
3eb28c
Subject: [PATCH] ldap: setup TLS when using ldaps
3eb28c
3eb28c
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1826964
3eb28c
---
3eb28c
 service/realm-ldap.c | 8 ++++++++
3eb28c
 1 file changed, 8 insertions(+)
3eb28c
3eb28c
diff --git a/service/realm-ldap.c b/service/realm-ldap.c
3eb28c
index 2076d1e..e07a299 100644
3eb28c
--- a/service/realm-ldap.c
3eb28c
+++ b/service/realm-ldap.c
3eb28c
@@ -263,6 +263,14 @@ realm_ldap_connect_anonymous (GSocketAddress *address,
3eb28c
 			return NULL;
3eb28c
 		}
3eb28c
 
3eb28c
+		if (use_ldaps) {
3eb28c
+			rc = ldap_install_tls (ls->ldap);
3eb28c
+			if (rc != LDAP_SUCCESS) {
3eb28c
+				g_warning ("ldap_start_tls_s() failed: %s", ldap_err2string (rc));
3eb28c
+				return NULL;
3eb28c
+			}
3eb28c
+		}
3eb28c
+
3eb28c
 		break;
3eb28c
 
3eb28c
 	case G_SOCKET_PROTOCOL_UDP:
3eb28c
-- 
3eb28c
2.28.0
3eb28c