# SSL/TLS Certificates for LDAP This directory should contain your SSL/TLS certificates for the LDAP server. ## Required Files The OpenLDAP container expects the following files in this directory: - `ca.crt` - Certificate Authority certificate (your dev-ca root certificate) - filename: `{.env:LDAP_TLS_CA_CRT_FILENAME}` - `server.crt` - Server certificate for `{.env:LDAP_HOSTNAME}` - filename: `{.env:LDAP_TLS_CRT_FILENAME}` - `server.key` - Private key for the server certificate - filename: `{.env:LDAP_TLS_KEY_FILENAME}` ## Using Your Custom Dev-CA Certificates If you maintain your own dev-ca, simply copy your certificates here: ```bash # Copy your dev-ca generated certificates to this directory cp /path/to/your/dev-ca/certs/ldap-server.crt ./server.crt cp /path/to/your/dev-ca/private/ldap-server.key ./server.key cp /path/to/your/dev-ca/ca-cert.pem ./ca.crt ``` **Important Notes:** - The server certificate should be issued for the hostname `{.env:LDAP_HOSTNAME}` (default: `ldap.testing.local`) - The certificate can also include SANs (Subject Alternative Names) like: - `DNS:{.env:LDAP_HOSTNAME}` - `DNS:localhost` - `IP:127.0.0.1` - Ensure the private key is readable by the container (permissions should be 600 or 644) ## Generating Self-Signed Certificates (Quick Start) If you don't have your dev-ca handy and want to quickly test, you can generate self-signed certificates: ### Option 1: Using OpenSSL (Manual) ```bash # Generate CA private key openssl genrsa -out ca.key 4096 # Generate CA certificate openssl req -new -x509 -days 3650 -key ca.key -out ca.crt \ -subj "/C=US/ST=State/L=City/O=Testing Org/CN=Testing CA" # Generate server private key openssl genrsa -out server.key 4096 # Generate server certificate signing request (use your LDAP_HOSTNAME value) openssl req -new -key server.key -out server.csr \ -subj "/C=US/ST=State/L=City/O=Testing Org/CN={.env:LDAP_HOSTNAME}" # Create extensions file for SAN (use your LDAP_HOSTNAME value) cat > server-ext.cnf <