Blame SOURCES/0011-ad-add-ad_use_ldaps.patch

0d097b
From da0be382d95f0bdbc6ad5ccb68503456c2ee858b Mon Sep 17 00:00:00 2001
0d097b
From: Sumit Bose <sbose@redhat.com>
0d097b
Date: Thu, 26 Sep 2019 20:27:09 +0200
0d097b
Subject: [PATCH 11/13] ad: add ad_use_ldaps
0d097b
MIME-Version: 1.0
0d097b
Content-Type: text/plain; charset=UTF-8
0d097b
Content-Transfer-Encoding: 8bit
0d097b
0d097b
With this new boolean option the AD provider should only use the LDAPS
0d097b
port 636 and the Global Catalog port 3629 which is TLS protected as
0d097b
well.
0d097b
0d097b
Related to https://pagure.io/SSSD/sssd/issue/4131
0d097b
0d097b
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
0d097b
---
0d097b
 src/config/SSSDConfig/__init__.py.in      |  1 +
0d097b
 src/config/cfg_rules.ini                  |  1 +
0d097b
 src/config/etc/sssd.api.d/sssd-ad.conf    |  1 +
0d097b
 src/man/sssd-ad.5.xml                     | 20 +++++++++++++++++++
0d097b
 src/providers/ad/ad_common.c              | 24 +++++++++++++++++++----
0d097b
 src/providers/ad/ad_common.h              |  8 +++++++-
0d097b
 src/providers/ad/ad_init.c                |  8 +++++++-
0d097b
 src/providers/ad/ad_opts.c                |  1 +
0d097b
 src/providers/ad/ad_srv.c                 | 16 ++++++++++++---
0d097b
 src/providers/ad/ad_srv.h                 |  3 ++-
0d097b
 src/providers/ad/ad_subdomains.c          | 21 ++++++++++++++++++--
0d097b
 src/providers/ipa/ipa_subdomains_server.c |  4 ++--
0d097b
 12 files changed, 94 insertions(+), 14 deletions(-)
0d097b
0d097b
diff --git a/src/config/SSSDConfig/__init__.py.in b/src/config/SSSDConfig/__init__.py.in
0d097b
index eba89b461..84631862a 100644
0d097b
--- a/src/config/SSSDConfig/__init__.py.in
0d097b
+++ b/src/config/SSSDConfig/__init__.py.in
0d097b
@@ -252,6 +252,7 @@ option_strings = {
0d097b
     'ad_site' : _('a particular site to be used by the client'),
0d097b
     'ad_maximum_machine_account_password_age' : _('Maximum age in days before the machine account password should be renewed'),
0d097b
     'ad_machine_account_password_renewal_opts' : _('Option for tuning the machine account renewal task'),
0d097b
+    'ad_use_ldaps' : _('Use LDAPS port for LDAP and Global Catalog requests'),
0d097b
 
0d097b
     # [provider/krb5]
0d097b
     'krb5_kdcip' : _('Kerberos server address'),
0d097b
diff --git a/src/config/cfg_rules.ini b/src/config/cfg_rules.ini
0d097b
index c56d5a668..1034a1fd6 100644
0d097b
--- a/src/config/cfg_rules.ini
0d097b
+++ b/src/config/cfg_rules.ini
0d097b
@@ -464,6 +464,7 @@ option = ad_machine_account_password_renewal_opts
0d097b
 option = ad_maximum_machine_account_password_age
0d097b
 option = ad_server
0d097b
 option = ad_site
0d097b
+option = ad_use_ldaps
0d097b
 
0d097b
 # IPA provider specific options
0d097b
 option = ipa_anchor_uuid
0d097b
diff --git a/src/config/etc/sssd.api.d/sssd-ad.conf b/src/config/etc/sssd.api.d/sssd-ad.conf
0d097b
index aaa0b2345..a2af72603 100644
0d097b
--- a/src/config/etc/sssd.api.d/sssd-ad.conf
0d097b
+++ b/src/config/etc/sssd.api.d/sssd-ad.conf
0d097b
@@ -20,6 +20,7 @@ ad_gpo_default_right = str, None, false
0d097b
 ad_site = str, None, false
0d097b
 ad_maximum_machine_account_password_age = int, None, false
0d097b
 ad_machine_account_password_renewal_opts = str, None, false
0d097b
+ad_use_ldaps = bool, None, false
0d097b
 ldap_uri = str, None, false
0d097b
 ldap_backup_uri = str, None, false
0d097b
 ldap_search_base = str, None, false
0d097b
diff --git a/src/man/sssd-ad.5.xml b/src/man/sssd-ad.5.xml
0d097b
index fdcb4e4b9..ade56cd6d 100644
0d097b
--- a/src/man/sssd-ad.5.xml
0d097b
+++ b/src/man/sssd-ad.5.xml
0d097b
@@ -1015,6 +1015,26 @@ ad_gpo_map_deny = +my_pam_service
0d097b
                     </listitem>
0d097b
                 </varlistentry>
0d097b
 
0d097b
+                <varlistentry>
0d097b
+                   <term>ad_use_ldaps (bool)</term>
0d097b
+                    <listitem>
0d097b
+                        <para>
0d097b
+                            By default SSSD uses the plain LDAP port 389 and the
0d097b
+                            Global Catalog port 3628. If this option is set to
0d097b
+                            True SSSD will use the LDAPS port 636 and Global
0d097b
+                            Catalog port 3629 with LDAPS protection. Since AD
0d097b
+                            does not allow to have multiple encryption layers on
0d097b
+                            a single connection and we still want to use
0d097b
+                            SASL/GSSAPI or SASL/GSS-SPNEGO for authentication
0d097b
+                            the SASL security property maxssf is set to 0 (zero)
0d097b
+                            for those connections.
0d097b
+                        </para>
0d097b
+                        <para>
0d097b
+                            Default: False
0d097b
+                        </para>
0d097b
+                    </listitem>
0d097b
+                </varlistentry>
0d097b
+
0d097b
                 <varlistentry>
0d097b
                     <term>dyndns_update (boolean)</term>
0d097b
                     <listitem>
0d097b
diff --git a/src/providers/ad/ad_common.c b/src/providers/ad/ad_common.c
0d097b
index 600e3ceb2..a2369166a 100644
0d097b
--- a/src/providers/ad/ad_common.c
0d097b
+++ b/src/providers/ad/ad_common.c
0d097b
@@ -729,6 +729,7 @@ ad_failover_init(TALLOC_CTX *mem_ctx, struct be_ctx *bectx,
0d097b
                  const char *ad_gc_service,
0d097b
                  const char *ad_domain,
0d097b
                  bool use_kdcinfo,
0d097b
+                 bool ad_use_ldaps,
0d097b
                  size_t n_lookahead_primary,
0d097b
                  size_t n_lookahead_backup,
0d097b
                  struct ad_service **_service)
0d097b
@@ -746,6 +747,16 @@ ad_failover_init(TALLOC_CTX *mem_ctx, struct be_ctx *bectx,
0d097b
         goto done;
0d097b
     }
0d097b
 
0d097b
+    if (ad_use_ldaps) {
0d097b
+        service->ldap_scheme = "ldaps";
0d097b
+        service->port = LDAPS_PORT;
0d097b
+        service->gc_port = AD_GC_LDAPS_PORT;
0d097b
+    } else {
0d097b
+        service->ldap_scheme = "ldap";
0d097b
+        service->port = LDAP_PORT;
0d097b
+        service->gc_port = AD_GC_PORT;
0d097b
+    }
0d097b
+
0d097b
     service->sdap = talloc_zero(service, struct sdap_service);
0d097b
     service->gc = talloc_zero(service, struct sdap_service);
0d097b
     if (!service->sdap || !service->gc) {
0d097b
@@ -927,7 +938,8 @@ ad_resolve_callback(void *private_data, struct fo_server *server)
0d097b
         goto done;
0d097b
     }
0d097b
 
0d097b
-    new_uri = talloc_asprintf(service->sdap, "ldap://%s", srv_name);
0d097b
+    new_uri = talloc_asprintf(service->sdap, "%s://%s", service->ldap_scheme,
0d097b
+                                                        srv_name);
0d097b
     if (!new_uri) {
0d097b
         DEBUG(SSSDBG_CRIT_FAILURE, "Failed to copy URI\n");
0d097b
         ret = ENOMEM;
0d097b
@@ -935,7 +947,7 @@ ad_resolve_callback(void *private_data, struct fo_server *server)
0d097b
     }
0d097b
     DEBUG(SSSDBG_CONF_SETTINGS, "Constructed uri '%s'\n", new_uri);
0d097b
 
0d097b
-    sockaddr = resolv_get_sockaddr_address(tmp_ctx, srvaddr, LDAP_PORT);
0d097b
+    sockaddr = resolv_get_sockaddr_address(tmp_ctx, srvaddr, service->port);
0d097b
     if (sockaddr == NULL) {
0d097b
         DEBUG(SSSDBG_CRIT_FAILURE, "resolv_get_sockaddr_address failed.\n");
0d097b
         ret = EIO;
0d097b
@@ -951,8 +963,12 @@ ad_resolve_callback(void *private_data, struct fo_server *server)
0d097b
     talloc_zfree(service->gc->uri);
0d097b
     talloc_zfree(service->gc->sockaddr);
0d097b
     if (sdata && sdata->gc) {
0d097b
-        new_port = fo_get_server_port(server);
0d097b
-        new_port = (new_port == 0) ? AD_GC_PORT : new_port;
0d097b
+        if (service->gc_port == AD_GC_LDAPS_PORT) {
0d097b
+            new_port = service->gc_port;
0d097b
+        } else {
0d097b
+            new_port = fo_get_server_port(server);
0d097b
+            new_port = (new_port == 0) ? service->gc_port : new_port;
0d097b
+        }
0d097b
 
0d097b
         service->gc->uri = talloc_asprintf(service->gc, "%s:%d",
0d097b
                                            new_uri, new_port);
0d097b
diff --git a/src/providers/ad/ad_common.h b/src/providers/ad/ad_common.h
0d097b
index 75f11de2e..820e06124 100644
0d097b
--- a/src/providers/ad/ad_common.h
0d097b
+++ b/src/providers/ad/ad_common.h
0d097b
@@ -29,7 +29,8 @@
0d097b
 #define AD_SERVICE_NAME    "AD"
0d097b
 #define AD_GC_SERVICE_NAME "AD_GC"
0d097b
 /* The port the Global Catalog runs on */
0d097b
-#define AD_GC_PORT      3268
0d097b
+#define AD_GC_PORT         3268
0d097b
+#define AD_GC_LDAPS_PORT   3269
0d097b
 
0d097b
 #define AD_AT_OBJECT_SID "objectSID"
0d097b
 #define AD_AT_DNS_DOMAIN "DnsDomain"
0d097b
@@ -67,6 +68,7 @@ enum ad_basic_opt {
0d097b
     AD_KRB5_CONFD_PATH,
0d097b
     AD_MAXIMUM_MACHINE_ACCOUNT_PASSWORD_AGE,
0d097b
     AD_MACHINE_ACCOUNT_PASSWORD_RENEWAL_OPTS,
0d097b
+    AD_USE_LDAPS,
0d097b
 
0d097b
     AD_OPTS_BASIC /* opts counter */
0d097b
 };
0d097b
@@ -82,6 +84,9 @@ struct ad_service {
0d097b
     struct sdap_service *sdap;
0d097b
     struct sdap_service *gc;
0d097b
     struct krb5_service *krb5_service;
0d097b
+    const char *ldap_scheme;
0d097b
+    int port;
0d097b
+    int gc_port;
0d097b
 };
0d097b
 
0d097b
 struct ad_options {
0d097b
@@ -147,6 +152,7 @@ ad_failover_init(TALLOC_CTX *mem_ctx, struct be_ctx *ctx,
0d097b
                  const char *ad_gc_service,
0d097b
                  const char *ad_domain,
0d097b
                  bool use_kdcinfo,
0d097b
+                 bool ad_use_ldaps,
0d097b
                  size_t n_lookahead_primary,
0d097b
                  size_t n_lookahead_backup,
0d097b
                  struct ad_service **_service);
0d097b
diff --git a/src/providers/ad/ad_init.c b/src/providers/ad/ad_init.c
0d097b
index 290d5b5c1..2b4b9e2e7 100644
0d097b
--- a/src/providers/ad/ad_init.c
0d097b
+++ b/src/providers/ad/ad_init.c
0d097b
@@ -138,6 +138,7 @@ static errno_t ad_init_options(TALLOC_CTX *mem_ctx,
0d097b
     char *ad_servers = NULL;
0d097b
     char *ad_backup_servers = NULL;
0d097b
     char *ad_realm;
0d097b
+    bool ad_use_ldaps = false;
0d097b
     errno_t ret;
0d097b
 
0d097b
     ad_sasl_initialize();
0d097b
@@ -154,12 +155,14 @@ static errno_t ad_init_options(TALLOC_CTX *mem_ctx,
0d097b
     ad_servers = dp_opt_get_string(ad_options->basic, AD_SERVER);
0d097b
     ad_backup_servers = dp_opt_get_string(ad_options->basic, AD_BACKUP_SERVER);
0d097b
     ad_realm = dp_opt_get_string(ad_options->basic, AD_KRB5_REALM);
0d097b
+    ad_use_ldaps = dp_opt_get_bool(ad_options->basic, AD_USE_LDAPS);
0d097b
 
0d097b
     /* Set up the failover service */
0d097b
     ret = ad_failover_init(ad_options, be_ctx, ad_servers, ad_backup_servers,
0d097b
                            ad_realm, AD_SERVICE_NAME, AD_GC_SERVICE_NAME,
0d097b
                            dp_opt_get_string(ad_options->basic, AD_DOMAIN),
0d097b
                            false, /* will be set in ad_get_auth_options() */
0d097b
+                           ad_use_ldaps,
0d097b
                            (size_t) -1,
0d097b
                            (size_t) -1,
0d097b
                            &ad_options->service);
0d097b
@@ -184,11 +187,13 @@ static errno_t ad_init_srv_plugin(struct be_ctx *be_ctx,
0d097b
     const char *ad_site_override;
0d097b
     bool sites_enabled;
0d097b
     errno_t ret;
0d097b
+    bool ad_use_ldaps;
0d097b
 
0d097b
     hostname = dp_opt_get_string(ad_options->basic, AD_HOSTNAME);
0d097b
     ad_domain = dp_opt_get_string(ad_options->basic, AD_DOMAIN);
0d097b
     ad_site_override = dp_opt_get_string(ad_options->basic, AD_SITE);
0d097b
     sites_enabled = dp_opt_get_bool(ad_options->basic, AD_ENABLE_DNS_SITES);
0d097b
+    ad_use_ldaps = dp_opt_get_bool(ad_options->basic, AD_USE_LDAPS);
0d097b
 
0d097b
 
0d097b
     if (!sites_enabled) {
0d097b
@@ -205,7 +210,8 @@ static errno_t ad_init_srv_plugin(struct be_ctx *be_ctx,
0d097b
     srv_ctx = ad_srv_plugin_ctx_init(be_ctx, be_ctx, be_ctx->be_res,
0d097b
                                      default_host_dbs, ad_options->id,
0d097b
                                      hostname, ad_domain,
0d097b
-                                     ad_site_override);
0d097b
+                                     ad_site_override,
0d097b
+                                     ad_use_ldaps);
0d097b
     if (srv_ctx == NULL) {
0d097b
         DEBUG(SSSDBG_FATAL_FAILURE, "Out of memory?\n");
0d097b
         return ENOMEM;
0d097b
diff --git a/src/providers/ad/ad_opts.c b/src/providers/ad/ad_opts.c
0d097b
index 1293219ee..30f9b62fd 100644
0d097b
--- a/src/providers/ad/ad_opts.c
0d097b
+++ b/src/providers/ad/ad_opts.c
0d097b
@@ -54,6 +54,7 @@ struct dp_option ad_basic_opts[] = {
0d097b
     { "krb5_confd_path", DP_OPT_STRING, { KRB5_MAPPING_DIR }, NULL_STRING },
0d097b
     { "ad_maximum_machine_account_password_age", DP_OPT_NUMBER, { .number = 30 }, NULL_NUMBER },
0d097b
     { "ad_machine_account_password_renewal_opts", DP_OPT_STRING, { "86400:750" }, NULL_STRING },
0d097b
+    { "ad_use_ldaps", DP_OPT_BOOL, BOOL_FALSE, BOOL_FALSE },
0d097b
     DP_OPTION_TERMINATOR
0d097b
 };
0d097b
 
0d097b
diff --git a/src/providers/ad/ad_srv.c b/src/providers/ad/ad_srv.c
0d097b
index 5fd25f60e..ca15d3715 100644
0d097b
--- a/src/providers/ad/ad_srv.c
0d097b
+++ b/src/providers/ad/ad_srv.c
0d097b
@@ -244,6 +244,7 @@ struct ad_get_client_site_state {
0d097b
     enum host_database *host_db;
0d097b
     struct sdap_options *opts;
0d097b
     const char *ad_domain;
0d097b
+    bool ad_use_ldaps;
0d097b
     struct fo_server_info *dcs;
0d097b
     size_t num_dcs;
0d097b
     size_t dc_index;
0d097b
@@ -264,6 +265,7 @@ struct tevent_req *ad_get_client_site_send(TALLOC_CTX *mem_ctx,
0d097b
                                            enum host_database *host_db,
0d097b
                                            struct sdap_options *opts,
0d097b
                                            const char *ad_domain,
0d097b
+                                           bool ad_use_ldaps,
0d097b
                                            struct fo_server_info *dcs,
0d097b
                                            size_t num_dcs)
0d097b
 {
0d097b
@@ -288,6 +290,7 @@ struct tevent_req *ad_get_client_site_send(TALLOC_CTX *mem_ctx,
0d097b
     state->host_db = host_db;
0d097b
     state->opts = opts;
0d097b
     state->ad_domain = ad_domain;
0d097b
+    state->ad_use_ldaps = ad_use_ldaps;
0d097b
     state->dcs = dcs;
0d097b
     state->num_dcs = num_dcs;
0d097b
 
0d097b
@@ -331,8 +334,11 @@ static errno_t ad_get_client_site_next_dc(struct tevent_req *req)
0d097b
     subreq = sdap_connect_host_send(state, state->ev, state->opts,
0d097b
                                     state->be_res->resolv,
0d097b
                                     state->be_res->family_order,
0d097b
-                                    state->host_db, "ldap", state->dc.host,
0d097b
-                                    state->dc.port, false);
0d097b
+                                    state->host_db,
0d097b
+                                    state->ad_use_ldaps ? "ldaps" : "ldap",
0d097b
+                                    state->dc.host,
0d097b
+                                    state->ad_use_ldaps ? 636 : state->dc.port,
0d097b
+                                    false);
0d097b
     if (subreq == NULL) {
0d097b
         ret = ENOMEM;
0d097b
         goto done;
0d097b
@@ -491,6 +497,7 @@ struct ad_srv_plugin_ctx {
0d097b
     const char *ad_domain;
0d097b
     const char *ad_site_override;
0d097b
     const char *current_site;
0d097b
+    bool ad_use_ldaps;
0d097b
 };
0d097b
 
0d097b
 struct ad_srv_plugin_ctx *
0d097b
@@ -501,7 +508,8 @@ ad_srv_plugin_ctx_init(TALLOC_CTX *mem_ctx,
0d097b
                        struct sdap_options *opts,
0d097b
                        const char *hostname,
0d097b
                        const char *ad_domain,
0d097b
-                       const char *ad_site_override)
0d097b
+                       const char *ad_site_override,
0d097b
+                       bool ad_use_ldaps)
0d097b
 {
0d097b
     struct ad_srv_plugin_ctx *ctx = NULL;
0d097b
     errno_t ret;
0d097b
@@ -515,6 +523,7 @@ ad_srv_plugin_ctx_init(TALLOC_CTX *mem_ctx,
0d097b
     ctx->be_res = be_res;
0d097b
     ctx->host_dbs = host_dbs;
0d097b
     ctx->opts = opts;
0d097b
+    ctx->ad_use_ldaps = ad_use_ldaps;
0d097b
 
0d097b
     ctx->hostname = talloc_strdup(ctx, hostname);
0d097b
     if (ctx->hostname == NULL) {
0d097b
@@ -714,6 +723,7 @@ static void ad_srv_plugin_dcs_done(struct tevent_req *subreq)
0d097b
                                      state->ctx->host_dbs,
0d097b
                                      state->ctx->opts,
0d097b
                                      state->discovery_domain,
0d097b
+                                     state->ctx->ad_use_ldaps,
0d097b
                                      dcs, num_dcs);
0d097b
     if (subreq == NULL) {
0d097b
         ret = ENOMEM;
0d097b
diff --git a/src/providers/ad/ad_srv.h b/src/providers/ad/ad_srv.h
0d097b
index e553d594d..8e410ec26 100644
0d097b
--- a/src/providers/ad/ad_srv.h
0d097b
+++ b/src/providers/ad/ad_srv.h
0d097b
@@ -31,7 +31,8 @@ ad_srv_plugin_ctx_init(TALLOC_CTX *mem_ctx,
0d097b
                        struct sdap_options *opts,
0d097b
                        const char *hostname,
0d097b
                        const char *ad_domain,
0d097b
-                       const char *ad_site_override);
0d097b
+                       const char *ad_site_override,
0d097b
+                       bool ad_use_ldaps);
0d097b
 
0d097b
 struct tevent_req *ad_srv_plugin_send(TALLOC_CTX *mem_ctx,
0d097b
                                        struct tevent_context *ev,
0d097b
diff --git a/src/providers/ad/ad_subdomains.c b/src/providers/ad/ad_subdomains.c
0d097b
index 2ce34489f..d8c201437 100644
0d097b
--- a/src/providers/ad/ad_subdomains.c
0d097b
+++ b/src/providers/ad/ad_subdomains.c
0d097b
@@ -282,6 +282,7 @@ ad_subdom_ad_ctx_new(struct be_ctx *be_ctx,
0d097b
     bool use_kdcinfo = false;
0d097b
     size_t n_lookahead_primary = SSS_KRB5_LOOKAHEAD_PRIMARY_DEFAULT;
0d097b
     size_t n_lookahead_backup = SSS_KRB5_LOOKAHEAD_BACKUP_DEFAULT;
0d097b
+    bool ad_use_ldaps = false;
0d097b
 
0d097b
     realm = dp_opt_get_cstring(id_ctx->ad_options->basic, AD_KRB5_REALM);
0d097b
     hostname = dp_opt_get_cstring(id_ctx->ad_options->basic, AD_HOSTNAME);
0d097b
@@ -312,6 +313,21 @@ ad_subdom_ad_ctx_new(struct be_ctx *be_ctx,
0d097b
         return ENOMEM;
0d097b
     }
0d097b
 
0d097b
+    ret = ad_inherit_opts_if_needed(id_ctx->ad_options->basic,
0d097b
+                                    ad_options->basic,
0d097b
+                                    be_ctx->cdb, subdom_conf_path,
0d097b
+                                    AD_USE_LDAPS);
0d097b
+    if (ret != EOK) {
0d097b
+        DEBUG(SSSDBG_CRIT_FAILURE,
0d097b
+              "Failed to inherit option [%s] to sub-domain [%s]. "
0d097b
+              "This error is ignored but might cause issues or unexpected "
0d097b
+              "behavior later on.\n",
0d097b
+              id_ctx->ad_options->basic[AD_USE_LDAPS].opt_name,
0d097b
+              subdom->name);
0d097b
+
0d097b
+        return ret;
0d097b
+    }
0d097b
+
0d097b
     ret = ad_inherit_opts_if_needed(id_ctx->sdap_id_ctx->opts->basic,
0d097b
                                     ad_options->id->basic,
0d097b
                                     be_ctx->cdb, subdom_conf_path,
0d097b
@@ -344,6 +360,7 @@ ad_subdom_ad_ctx_new(struct be_ctx *be_ctx,
0d097b
 
0d097b
     servers = dp_opt_get_string(ad_options->basic, AD_SERVER);
0d097b
     backup_servers = dp_opt_get_string(ad_options->basic, AD_BACKUP_SERVER);
0d097b
+    ad_use_ldaps = dp_opt_get_bool(ad_options->basic, AD_USE_LDAPS);
0d097b
 
0d097b
     if (id_ctx->ad_options->auth_ctx != NULL
0d097b
             && id_ctx->ad_options->auth_ctx->opts != NULL) {
0d097b
@@ -362,7 +379,7 @@ ad_subdom_ad_ctx_new(struct be_ctx *be_ctx,
0d097b
 
0d097b
     ret = ad_failover_init(ad_options, be_ctx, servers, backup_servers,
0d097b
                            subdom->realm, service_name, gc_service_name,
0d097b
-                           subdom->name, use_kdcinfo,
0d097b
+                           subdom->name, use_kdcinfo, ad_use_ldaps,
0d097b
                            n_lookahead_primary,
0d097b
                            n_lookahead_backup,
0d097b
                            &ad_options->service);
0d097b
@@ -386,7 +403,7 @@ ad_subdom_ad_ctx_new(struct be_ctx *be_ctx,
0d097b
                                      ad_id_ctx->ad_options->id,
0d097b
                                      hostname,
0d097b
                                      ad_domain,
0d097b
-                                     ad_site_override);
0d097b
+                                     ad_site_override, ad_use_ldaps);
0d097b
     if (srv_ctx == NULL) {
0d097b
         DEBUG(SSSDBG_FATAL_FAILURE, "Out of memory?\n");
0d097b
         return ENOMEM;
0d097b
diff --git a/src/providers/ipa/ipa_subdomains_server.c b/src/providers/ipa/ipa_subdomains_server.c
0d097b
index fd998877b..9aebf72a5 100644
0d097b
--- a/src/providers/ipa/ipa_subdomains_server.c
0d097b
+++ b/src/providers/ipa/ipa_subdomains_server.c
0d097b
@@ -319,7 +319,7 @@ ipa_ad_ctx_new(struct be_ctx *be_ctx,
0d097b
     ret = ad_failover_init(ad_options, be_ctx, ad_servers, ad_backup_servers,
0d097b
                            subdom->realm,
0d097b
                            service_name, gc_service_name,
0d097b
-                           subdom->name, use_kdcinfo,
0d097b
+                           subdom->name, use_kdcinfo, false,
0d097b
                            n_lookahead_primary, n_lookahead_backup,
0d097b
                            &ad_options->service);
0d097b
     if (ret != EOK) {
0d097b
@@ -344,7 +344,7 @@ ipa_ad_ctx_new(struct be_ctx *be_ctx,
0d097b
                                      ad_id_ctx->ad_options->id,
0d097b
                                      id_ctx->server_mode->hostname,
0d097b
                                      ad_domain,
0d097b
-                                     ad_site_override);
0d097b
+                                     ad_site_override, false);
0d097b
     if (srv_ctx == NULL) {
0d097b
         DEBUG(SSSDBG_FATAL_FAILURE, "Out of memory?\n");
0d097b
         return ENOMEM;
0d097b
-- 
0d097b
2.20.1
0d097b