Localhost.crt does not exist or is empty

It’s a problem with the mod_ssl package in RHEL8 and CentOS 8. When you install it the first time, it produces an invalid Apache configuration.

Supposedly, restarting Apache via systemd fixes it:

systemctl restart httpd

Beneath the hood, it causes the following command to run, which fixes generates the missing snakeoil certificates:

/usr/libexec/httpd-ssl-gencerts
2 Likes