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

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