Certificate not working on www. subdomain


#1

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?

https://wantsomeink.com
https://www.wantsomeink.com


#2

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.


#3

<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
SSLCipherSuite "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EEC$


#4

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/.


#5

Thanks pfg

That was exactly the issue, all sorted now.

Thanks for your help!