I am generating a certificate for a development environment and I am getting errors related to a mismatch in the hostname. Unfortunately, the VM keeps restarting with different hostname/IP address and it is out of my control. The error I get is:
hostname of the server '127.0.0.1' does not match the hostname in the server's certificate.
What I want to do is generate a certificate that specifically uses 127.0.0.1 as the hostname. This is for use with OpenLDAP on a Linux box and I typically use:
sudo openssl req -new -x509 -nodes \
-out /etc/pki/tls/certs/MyLDAP.pem \
-keyout /etc/pki/tls/certs/MyLDAP.key \
-days 365
This works fine when I have control of the node and know the hostname information. When I plug this in to my remote service that wants to use an LDAP URL (ldap://127.0.0.1:389
) it blows up. I want to force the certificate to use the standard internal IP.