I didn't generate a self signed certificate.
Your OS likely did this for you automatically to get you up and running. On Debian I believe it uses /etc/ssl/certs/ssl-cert-snakeoil.pem
by default.
/etc/letsencrypt/live and /etc/letsencrypt/archive directories had 700 perms so I did:
sudo chmod 755 /etc/letsencrypt/archive
sudo chmod 755 /etc/letsencrypt/live
No no no! Your private key is stored in there. That needs to be kept secret. They should be 700
and owned by root:root
. This is what my permissions look like and I'm pretty sure they're all default:
# tree -pufig /etc/letsencrypt/
/etc/letsencrypt
[drwx------ root root ] /etc/letsencrypt/accounts
[drwx------ root root ] /etc/letsencrypt/accounts/acme-v01.api.letsencrypt.org
[drwx------ root root ] /etc/letsencrypt/accounts/acme-v01.api.letsencrypt.org/directory
[drwx------ root root ] /etc/letsencrypt/accounts/acme-v01.api.letsencrypt.org/directory/daa23eff1d7af15ef4afae24c8caf325
[-rw-r--r-- root root ] /etc/letsencrypt/accounts/acme-v01.api.letsencrypt.org/directory/daa23eff1d7af15ef4afae24c8caf325/meta.json
[-r-------- root root ] /etc/letsencrypt/accounts/acme-v01.api.letsencrypt.org/directory/daa23eff1d7af15ef4afae24c8caf325/private_key.json
[-rw-r--r-- root root ] /etc/letsencrypt/accounts/acme-v01.api.letsencrypt.org/directory/daa23eff1d7af15ef4afae24c8caf325/regr.json
[drwx------ root root ] /etc/letsencrypt/archive
[drwxr-xr-x root root ] /etc/letsencrypt/archive/example.com
[-rw-r--r-- root root ] /etc/letsencrypt/archive/example.com/cert1.pem
[-rw-r--r-- root root ] /etc/letsencrypt/archive/example.com/chain1.pem
[-rw-r--r-- root root ] /etc/letsencrypt/archive/example.com/fullchain1.pem
[-rw-r--r-- root root ] /etc/letsencrypt/archive/example.com/privkey1.pem
[drwxr-xr-x root root ] /etc/letsencrypt/csr
[-rw-r--r-- root root ] /etc/letsencrypt/csr/0000_csr-letsencrypt.pem
[-rw-r--r-- root root ] /etc/letsencrypt/csr/0001_csr-letsencrypt.pem
[-rw-r--r-- root root ] /etc/letsencrypt/csr/0002_csr-letsencrypt.pem
[drwx------ root root ] /etc/letsencrypt/keys
[-rw------- root root ] /etc/letsencrypt/keys/0000_key-letsencrypt.pem
[-rw------- root root ] /etc/letsencrypt/keys/0001_key-letsencrypt.pem
[-rw------- root root ] /etc/letsencrypt/keys/0002_key-letsencrypt.pem
[drwx------ root root ] /etc/letsencrypt/live
[drwxr-xr-x root root ] /etc/letsencrypt/live/example.com
[lrwxrwxrwx root root ] /etc/letsencrypt/live/example.com/cert.pem -> ../../archive/example.com/cert1.pem
[lrwxrwxrwx root root ] /etc/letsencrypt/live/example.com/chain.pem -> ../../archive/example.com/chain1.pem
[lrwxrwxrwx root root ] /etc/letsencrypt/live/example.com/fullchain.pem -> ../../archive/example.com/fullchain1.pem
[lrwxrwxrwx root root ] /etc/letsencrypt/live/example.com/privkey.pem -> ../../archive/example.com/privkey1.pem
[drwxr-xr-x root root ] /etc/letsencrypt/renewal
[-rwxr-xr-x root root ] /etc/letsencrypt/renewal/example.com.conf
This is just a wild guess, but the fact that the permissions of your private key are open may actually cause Apache to fail to load correctly as a safeguard. I know SSH does this if your keys have incorrect permissions.
Also, try executing the following commands (make sure it is what you have for SSLCertificateFile
and SSLCertificateChainFile
respectively):
# openssl x509 -in /etc/letsencrypt/live/yourdomain.com/cert.pem -text | grep Issuer
and
# openssl x509 -in /etc/letsencrypt/live/yourdomain.com/chain.pem -text | grep Issuer
You should see something like:
Issuer: C=US, O=Let's Encrypt, CN=Let's Encrypt Authority X1
CA Issuers - URI:http://cert.int-x1.letsencrypt.org/
and
Issuer: O=Digital Signature Trust Co., CN=DST Root CA X3
CA Issuers - URI:http://apps.identrust.com/roots/dstrootcax3.p7c
If you see anything else you somehow managed to overwrite one or both of these files. Somehow Apache is loading the wrong certificate files, so you just need to figure out why it's doing that and correct the problem. To get an overview of your VirtualHost configuration execute apache2ctl -S
and make sure you're actually editing the correct file(s).