New Hosting Machine

I host this little web site at home on an Ubuntu Linux machine.  Just for kicks, I recently bought a new, more beefy machine and migrated everything over from the old machine to the new one.

I use LetsEncrypt certificates to provide HTTPs on this site.  (They’re FREE)  When I was copying files from the old machine to the new machine, I just copied the entire /etc/letsencrypt directory and went on my merry way.  Everything ran fine and Apache was happily running with the certificates at their specified locations.

Yesterday, however, my certificates expired.  I tried to run “certbot” to renew my certificates but I received a strange error.  First, however, I was warned that my certificates in /etc/letsencrypt/live were not symbolic links.  It was true; I had simply copied the certs from wherever they were to the “live” directory.  So, I just put the certs somewhere else and made a symbolic link to them.  That’s when the strange error started happening when I tried to renew the certificates.  The error was something like this:

TypeError:  not supported between instances of 'NoneType' and 'NoneType'

Thankfully, certbot is written in Python so I could try to take a look at the code.  After looking it over a bit, I figured out that it’s probably best to put the certificate in the “archive” directory and link to it from “live”.  There were 14 PEM files in the archive directory, and the last was named “cert14.pem”, so I just linked the cert.pem in the live directory to that file.  I did this for all four files used to support TLS and when I reran certbot…BINGO!  All the certs had been renewed and the site was back in working order.

Leave a Reply