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

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