I have set up an openLDAP backed MIT Kerberos realm on a server after much iteration, and I am now trying to move it to its own server. When I first set it up on the original server, I created a local realm, then moved it to one backed by openLDAP which was installed on the same server.
On the new server, I've set up openldap and populated it, including setting up startTLS. I have validated the cert using openssl s_client. When I've gone forward to install kerberos, I started by trying to install krb5-kdc-ldap on Ubuntu Server 22.04.1 (which will install krb5-kdc as a dependency). The krb5-kdc package does not properly install; I tell it to not create the initial config, and when the installer tries to start the service, it fails with the following error:
Cannot open DB2 database '/var/lib/krb5kdc/principal': No such file or directory - while initializing database for realm SUBDOMAIN.DOMAIN.COM
For now, that is fine; it's expected, I'm not creating a file-based realm, we'll be hooking into the LDAP server as our DB. I then define most of my krb5 settings in /etc/krb5.conf. Dbmodules is defined in the krb5.conf pointing to "ldapi:///" and I am not pointing to a keyfile or bind user yet. I then try to create the realm with the following command:
kdb5_ldap_util -D cn=admin,dc=subdomain,dc=domain,dc=com -H ldapi:/// create -subtrees dc=subdomain,dc=domain,dc=com -sscope SUB -r SUBDOMAIN.DOMAIN.COM
However, I get the output that I cannot bind to the LDAP server because "Confidentiality required while initializing database". My understanding is this is a StartTLS issue; with commands like ldapadd I get a similar error when I don't pass the "-ZZ" flag. Is there a way to initiate krb5_ldap_util over startTLS? Am I doing things in the wrong order; in the existing environment things were done in so many iterations I'm not sure the order I did to get it working. Is there a step in setting up krb5.conf to indicate something about TLS; I don't have that in my existing working setup, and I'm not seeing anything in the documentation that leads me to the right path. I am using an internal certificate authority, and I have validated that the OpenLDAP server is serving a domain cert that will validate on my other clients, and I have validated that the CA is in the root CA store on the new LDAP server. I keep suspecting I just have a cert problem, but all checks are passing with flying colors.
Edit: ldif file I used for forcing TLS, per the comment below:
dn: olcDatabase={1}mdb,cn=config
changetype: modify
add: olcSecurity
olcSecurity: tls=1