1
/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
8
* http://www.apache.org/licenses/LICENSE-2.0
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
18
* @file apr_ldap_init.h
19
* @brief APR-UTIL LDAP ldap_init() functions
21
#ifndef APR_LDAP_INIT_H
22
#define APR_LDAP_INIT_H
25
* @defgroup APR_Util_LDAP LDAP
36
#endif /* __cplusplus */
39
* APR LDAP SSL Initialise function
41
* This function initialises SSL on the underlying LDAP toolkit
42
* if this is necessary.
44
* If a CA certificate is provided, this is set, however the setting
45
* of certificates via this method has been deprecated and will be removed in
48
* The apr_ldap_set_option() function with the APR_LDAP_OPT_TLS_CERT option
49
* should be used instead to set certificates.
51
* If SSL support is not available on this platform, or a problem
52
* was encountered while trying to set the certificate, the function
53
* will return APR_EGENERAL. Further LDAP specific error information
54
* can be found in result_err.
55
* @param pool The pool to use
56
* @param cert_auth_file The name of the certificate to use, can be NULL
57
* @param cert_file_type The type of certificate specified. See the
58
* apr_ldap_set_option() APR_LDAP_OPT_TLS_CERT option for details.
59
* @param result_err The returned result
61
APU_DECLARE(int) apr_ldap_ssl_init(apr_pool_t *pool,
62
const char *cert_auth_file,
64
apr_ldap_err_t **result_err);
67
* APR LDAP SSL De-Initialise function
69
* This function tears down any SSL certificate setup previously
70
* set using apr_ldap_ssl_init(). It should be called to clean
71
* up if a graceful restart of a service is attempted.
72
* @todo currently we do not check whether apr_ldap_ssl_init()
73
* has been called first - we probably should.
75
APU_DECLARE(int) apr_ldap_ssl_deinit(void);
78
* APR LDAP initialise function
80
* This function is responsible for initialising an LDAP
81
* connection in a toolkit independant way. It does the
82
* job of ldap_init() from the C api.
84
* It handles both the SSL and non-SSL case, and attempts
85
* to hide the complexity setup from the user. This function
86
* assumes that any certificate setup necessary has already
89
* If SSL or STARTTLS needs to be enabled, and the underlying
90
* toolkit supports it, the following values are accepted for
93
* APR_LDAP_NONE: No encryption
94
* APR_LDAP_SSL: SSL encryption (ldaps://)
95
* APR_LDAP_STARTTLS: Force STARTTLS on ldap://
96
* @remark The Novell toolkit is only able to set the SSL mode via this
97
* function. To work around this limitation, set the SSL mode here if no
98
* per connection client certificates are present, otherwise set secure
99
* APR_LDAP_NONE here, then set the per connection client certificates,
100
* followed by setting the SSL mode via apr_ldap_set_option(). As Novell
101
* does not support per connection client certificates, this problem is
102
* worked around while still being compatible with other LDAP toolkits.
103
* @param pool The pool to use
104
* @param ldap The LDAP handle
105
* @param hostname The name of the host to connect to. This can be either a
106
* DNS name, or an IP address.
107
* @param portno The port to connect to
108
* @param secure The security mode to set
109
* @param result_err The returned result
111
APU_DECLARE(int) apr_ldap_init(apr_pool_t *pool,
113
const char *hostname,
116
apr_ldap_err_t **result_err);
119
* APR LDAP info function
121
* This function returns a string describing the LDAP toolkit
122
* currently in use. The string is placed inside result_err->reason.
123
* @param pool The pool to use
124
* @param result_err The returned result
126
APU_DECLARE(int) apr_ldap_info(apr_pool_t *pool,
127
apr_ldap_err_t **result_err);
133
#endif /* APR_HAS_LDAP */
137
#endif /* APR_LDAP_URL_H */