diff options
author | Tyson Whitehead <twhitehead@gmail.com> | 2011-01-19 15:22:49 -0500 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2011-01-20 12:20:15 -0500 |
commit | 3c13b616108d4c0a413380ba72189947898eee57 (patch) | |
tree | c3700f4289a40f60b1ac36e46a100344b94394e7 /src/providers/ldap/sdap.c | |
parent | 2fac679ce284b21bd49b4241f0b9e5a5db1bd0c6 (diff) | |
download | sssd-3c13b616108d4c0a413380ba72189947898eee57.tar.gz sssd-3c13b616108d4c0a413380ba72189947898eee57.tar.bz2 sssd-3c13b616108d4c0a413380ba72189947898eee57.zip |
Add ldap_tls_{cert,key,cipher_suite} config options
Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
Diffstat (limited to 'src/providers/ldap/sdap.c')
-rw-r--r-- | src/providers/ldap/sdap.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/providers/ldap/sdap.c b/src/providers/ldap/sdap.c index 573de178..ea2eabe7 100644 --- a/src/providers/ldap/sdap.c +++ b/src/providers/ldap/sdap.c @@ -350,6 +350,33 @@ errno_t setup_tls_config(struct dp_option *basic_opts) } } + tls_opt = dp_opt_get_string(basic_opts, SDAP_TLS_CERT); + if (tls_opt) { + ret = ldap_set_option(NULL, LDAP_OPT_X_TLS_CERTFILE, tls_opt); + if (ret != LDAP_OPT_SUCCESS) { + DEBUG(1, ("ldap_set_option failed: %s\n", ldap_err2string(ret))); + return EIO; + } + } + + tls_opt = dp_opt_get_string(basic_opts, SDAP_TLS_KEY); + if (tls_opt) { + ret = ldap_set_option(NULL, LDAP_OPT_X_TLS_KEYFILE, tls_opt); + if (ret != LDAP_OPT_SUCCESS) { + DEBUG(1, ("ldap_set_option failed: %s\n", ldap_err2string(ret))); + return EIO; + } + } + + tls_opt = dp_opt_get_string(basic_opts, SDAP_TLS_CIPHER_SUITE); + if (tls_opt) { + ret = ldap_set_option(NULL, LDAP_OPT_X_TLS_CIPHER_SUITE, tls_opt); + if (ret != LDAP_OPT_SUCCESS) { + DEBUG(1, ("ldap_set_option failed: %s\n", ldap_err2string(ret))); + return EIO; + } + } + return EOK; } |