Certificate not working on www. subdomain

I added a certificate using the the following command

letsencrypt-auto certonly --webroot -w /pathtopublic -d wantsomeink.com -d www.wantsomeink.com

(pathtopublic is just for this example, I used the correct path)

It works fine without the www. but not with. Any suggestions?


www.wantsomeink.com is using a self-signed certificate. Mind sharing your web server configuration? I’m guessing there’s a reference to that certificate somewhere in there.

<VirtualHost *:443>
ServerName wantsomeink.com
DocumentRoot "pathtopublic"
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/wantsomeink.com/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/wantsomeink.com/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/wantsomeink.com/chain.pem
SSLProtocol All -SSLv2 -SSLv3
SSLHonorCipherOrder on

You’ll probably want a ServerAlias www.wantsomeink.com in there, otherwise apache might pick any other <VirtualHost> when serving www.wantsomeink.com.

I’m guessing you have another <VirtualHost> that points to a self-signed certificate. You’ll probably be able to find it with grep -r "SSLCertificate" /etc/apache2/.

Thanks pfg

That was exactly the issue, all sorted now.

Thanks for your help!