xref: /PHP-5.6/ext/ldap/tests/README (revision 42f7e4c0)
1Most tests here relies on the availability of an LDAP server configured with TLS.
2
3Client/Server configuration:
4===========================================================
5OpenLDAP 2.4.31 has been used with the configuration below.
6
7Notes:
81.  A self signed certificate can be generated using:
9    $ openssl req -newkey rsa:1024 -x509 -nodes -out server.pem -keyout server.pem -days 3650
10    It is used for testing ldap_start_tls(), which also requires "TLS_REQCERT never" in client configuration
112.  An empty LDAP structure is required for the tests to be PASSed (except for base and admin)
12
13If you use a debian based distribution, prefer the use of dpkg-reconfigure.
14Otherwise you may alter these configuration files:
15
16(/etc/openldap/)slapd.conf:
17-----------------------------------------------------------
18TLSCACertificateFile /etc/openldap/ssl/server.pem
19TLSCertificateFile /etc/openldap/ssl/server.pem
20TLSCertificateKeyFile /etc/openldap/ssl/server.pem
21TLSVerifyClient never
22
23# hdb is used instead of bdb as it enables the usage of referrals & aliases
24database        hdb
25suffix          "dc=my-domain,dc=com"
26checkpoint      32      30
27rootdn          "cn=Manager,dc=my-domain,dc=com"
28rootpw          secret
29directory       /var/lib/openldap-data
30index   objectClass     eq
31
32authz-regexp
33	uid=Manager,cn=digest-md5,cn=auth
34	cn=Manager,dc=my-domain,dc=com
35
36
37(/etc/openldap/)ldap.conf:
38-----------------------------------------------------------
39TLS_REQCERT never
40
41Tests configuration:
42===========================================================
43The following environment variables may be defined:
44LDAP_TEST_HOST (default: localhost)                        Host to connect to
45LDAP_TEST_PORT (default: 389)                              Port to connect to
46LDAP_TEST_BASE (default: dc=my-domain,dc=com)              Base to use. May be the ldap root or a subtree. (ldap_search_variation6 will fail if a subtree is used)
47LDAP_TEST_USER (default: cn=Manager,dc=my-domain,dc=com)   DN used for binding
48LDAP_TEST_SASL_USER (default: Manager)                     SASL user used for SASL binding
49LDAP_TEST_PASSWD (default: secret)                         Password used for plain and SASL binding
50LDAP_TEST_OPT_PROTOCOL_VERSION (default: 3)                Version of LDAP protocol to use
51LDAP_TEST_SKIP_BIND_FAILURE (default: true)                Whether to fail the test or not in case binding fails
52
53Credits:
54===========================================================
55Davide Mendolia <idaf1er@gmail.com>
56Patrick Allaert <patrick.allaert@gmail.com>
57Côme Bernigaud <mcmic@php.net>
58