Howto use LDAPs in LDAP UserIdResolver
======================================

date:	06/28/2010
rev:	01

The LinOTP2 server may fetch its users from an LDAP server or Active Directory.
These servers might be running LDAPS, which means, the LDAP server has a certificate installed.
In case of Active Directory, the domain controllers would have a domain controller certificate
installed.

To make this work properly, you need to do the following steps:

 1. In the LDAP UserIdResolver configuration you need to enter 
    the LDAP URI like

	ldaps://yourserver.domain.tld

    i.e. 'ldaps' marks the the ldap connections should be encrypted and you
    need to provide the FQDN of the server. The FQDN must fit the CN in the
    certificate.

 2. You need to copy the CA certificate, that signed the certificate of your LDAP server/
    domain controller to your LinOTP2 server.
    Copy it to the following directory 

	/etc/ssl/certs/

    using your preferred scp client like winscp.

 3. The certificate needs to be in the base64 encoded PEM format. If you copied the 
    certificate from a Microsoft CA, it will probably be in the binary DER format.
    You can convert the certificate on the LinOTP2 server:

        openssl x509 -in /etc/ssl/certs/yourCA.der -inform DER -out /etc/ssl/certs/yourCA.pem

 4. Now you need to tell the ldap client that will connect to your LDAP server or Active Directory
    to trust this certificate. This can be done by adding the following line to the file
    /etc/ldap/ldap.conf:

	TLS_CACERT      /etc/ssl/certs/ca.crt

 5. A restart of the apache2 is also a good idea:

	/etc/init.d/apache2 restart

 Now the LinOTP2 server should be able to fetch the users via LDAPS.



