Cannot load certificate “/etc/ssl/certs/ssl-cert-snakeoil.pem” on Debian

cannot load certificate "/etc/ssl/certs/ssl-cert-snakeoil.pem" on debian

Recently, my media center (an Intel NUC) started to bark about being out of disk space on my root partition. Instead of just biting the bullet and redoing the partitions, I decided to purchase a larger SSD, which led to its own problems.

With those problems sorted, I opted to do a fresh installation of Debian. I could have cloned the old disk, but I was going from a 2 TB SSD to a 4 TB SSD. This meant I was going from master boot record (MBR) to GUID partition table (GPT). Having no experience with GPT or moving from MBR to GPT, it seemed safer to let the Debian installer deal with this.

Cannot load certificate

With Debian installed, I started to install the software I had previously installed, which included nginx to host a small internal API we use. Everything was fine, until I brought over my sites-enabled/*.conf files, which use the snakeoil SSL certificate.

As it turns out, the base Debian install doesn’t appear to include those files. Without those files, nginx wouldn’t start. When checking systemctl status nginx, I was greeted with this lovely error:

Cannot load certificate "/etc/ssl/certs/ssl-cert-snakeoil.pem"
systemctl status nginx

Buying snake oil

Cheaper than being grifted by somebody selling snake oil, all I needed to do was install the package that would install the snakeoil SSL cert:

% apt intall ssl-cert
Zsh

With that installed, I was able to systemctl start nginx and things started up as expected!

Josh Sherman - The Man, The Myth, The Avatar

About Josh

Husband. Father. Pug dad. Musician. Founder of Holiday API, Head of Engineering and Emoji Specialist at Mailshake, and author of the best damn Lorem Ipsum Library for PHP.


If you found this article helpful, please consider buying me a coffee.