summaryrefslogtreecommitdiff
path: root/ldap/apr_ldap_init.c
diff options
context:
space:
mode:
authorminfrin <minfrin@13f79535-47bb-0310-9956-ffa450edef68>2011-12-06 01:08:40 +0000
committerminfrin <minfrin@13f79535-47bb-0310-9956-ffa450edef68>2011-12-06 01:08:40 +0000
commitaca4351e2f768674a4a6928e634406e7385226d9 (patch)
tree45ba98a0f5e105e8c62181d11c7f5497c422972a /ldap/apr_ldap_init.c
parentc83b477521ed2aaf40c6a47d540c665ca9bd539c (diff)
parent796db2a03ab94945939e0e91c269a611463d43a8 (diff)
downloadlibapr-util-1.4.0.tar.gz
Tag v1.4.0.1.4.0
git-svn-id: http://svn.apache.org/repos/asf/apr/apr-util/tags/1.4.0@1210733 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'ldap/apr_ldap_init.c')
-rw-r--r--ldap/apr_ldap_init.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/ldap/apr_ldap_init.c b/ldap/apr_ldap_init.c
index 458f281b..8aacb2a5 100644
--- a/ldap/apr_ldap_init.c
+++ b/ldap/apr_ldap_init.c
@@ -156,13 +156,29 @@ APU_DECLARE_LDAP(int) apr_ldap_init(apr_pool_t *pool,
*result_err = result;
#if APR_HAS_LDAPSSL_INIT
+#if APR_HAS_SOLARIS_LDAPSDK
+ /*
+ * Using the secure argument should aways be possible. But as LDAP SDKs
+ * tend to have different quirks and bugs, this needs to be tested for
+ * for each of them, first. For Solaris LDAP it works, and the method
+ * with ldap_set_option doesn't.
+ */
+ *ldap = ldapssl_init(hostname, portno, secure == APR_LDAP_SSL);
+#else
*ldap = ldapssl_init(hostname, portno, 0);
+#endif
#elif APR_HAS_LDAP_SSLINIT
*ldap = ldap_sslinit((char *)hostname, portno, 0);
#else
*ldap = ldap_init((char *)hostname, portno);
#endif
+
if (*ldap != NULL) {
+#if APR_HAS_SOLARIS_LDAPSDK
+ if (secure == APR_LDAP_SSL)
+ return APR_SUCCESS;
+ else
+#endif
return apr_ldap_set_option(pool, *ldap, APR_LDAP_OPT_TLS, &secure, result_err);
}
else {