forked from 389ds/389-ds-base
-
Notifications
You must be signed in to change notification settings - Fork 0
Configuring SSL Connection in DS 1.4
Endi S. Dewata edited this page Sep 14, 2023
·
1 revision
In DS 1.4 or later the SSL is enabled by default with self-signed CA and server certificates in /etc/dirsrv/slapd-<instance>.
To display the SSL configuration:
$ ldapsearch -H ldap://$HOSTNAME:389 -x -D "cn=Directory Manager" -w Secret.123 -b "cn=encryption,cn=config" dn: cn=encryption,cn=config objectClass: top objectClass: nsEncryptionConfig cn: encryption nsSSLSessionTimeout: 0 nsSSLClientAuth: allowed CACertExtractFile: /etc/dirsrv/slapd-localhost/Self-Signed-CA.pem nsSSLSupportedCiphers: TLS_AES_128_GCM_SHA256::AES-GCM::AEAD::128 nsSSLSupportedCiphers: ... nssslenabledciphers: TLS_AES_128_GCM_SHA256::AES-GCM::AEAD::128 nssslenabledciphers: ... nsSSL2: off nsSSL3: off nsTLS1: on sslVersionMin: TLS1.2 sslVersionMax: TLS1.3 dn: cn=RSA,cn=encryption,cn=config objectClass: top objectClass: nsEncryptionModule cn: RSA nsSSLPersonalitySSL: Server-Cert nsSSLActivation: on nsSSLToken: internal (software)
To list DS certificates:
$ certutil -L -d /etc/dirsrv/slapd-localhost Certificate Nickname Trust Attributes SSL,S/MIME,JAR/XPI Self-Signed-CA CT,, Server-Cert u,u,u
To list DS certificate key:
$ certutil -K -d /etc/dirsrv/slapd-localhost -f /etc/dirsrv/slapd-localhost/pwdfile.txt certutil: Checking token "NSS Certificate DB" in slot "NSS User Private Key and Certificate Services" < 0> rsa 299bdc37b695519cb5f40f61d1e7283f8b161900 NSS Certificate DB:Server-Cert
To display DS signing certificate:
$ certutil -L -d /etc/dirsrv/slapd-localhost -n "Self-Signed-CA"
To display DS server certificate:
$ certutil -L -d /etc/dirsrv/slapd-localhost -n "Server-Cert"
See Enabling SSL Connection in DS.
See Exporting DS Certificates.
To import DS certificates and key from a PKCS #12 file:
$ pki -d /etc/dirsrv/slapd-localhost -C /etc/dirsrv/slapd-localhost/pwdfile.txt \ pkcs12-import --pkcs12-file tmp/sslserver.p12 --pkcs12-password Secret.123
To delete DS server certificate and its key:
$ certutil -F -d /etc/dirsrv/slapd-localhost -f /etc/dirsrv/slapd-localhost/pwdfile.txt -n Server-Cert
To deleete DS signing certificate:
$ certutil -D -d /etc/dirsrv/slapd-localhost -n "Self-Signed-CA"
To verify the SSL connection:
$ sslscan $HOSTNAME:636
To access DS via SSL connection without trusted DS signing certificate:
$ LDAPTLS_REQCERT=never \ ldapsearch -H ldaps://$HOSTNAME:636 -x -D "cn=Directory Manager" -w Secret.123 -s base -b "" \* +
To access DS via SSL connection with trusted DS signing certificate:
$ LDAPTLS_CACERT=/etc/dirsrv/slapd-localhost/Self-Signed-CA.pem \ ldapsearch -H ldaps://$HOSTNAME:636 -x -D "cn=Directory Manager" -w Secret.123 -s base -b "" \* +