B3af2dbe6b645a0f751c5098829dcb3bf6a9e8d3
By:
Phils

letsencrypt invalid SSL Cert

January 8, 2017 677 views
Nginx Let's Encrypt Ubuntu 16.04

I have just setup my website(nodejs) with nginx and using lets encrypt for the cert but having problems with "Invalid SSL Cerificate"

if I do a search examplesite.com it redirects to https://examplesite.com everything is fine but when If I search for www.examplesite.com it redirects to https://www.examplesite.com but gives me invalid ssl cerificate.

Anyone know whats going on?

Many thanks
Phil

1 Answer

@Phils

When you setup the certificate, did you specify both? If you do not pass both as options when creating the certificate, one will be valid and the other won't.

When creating the certificate, you need to pass:

-d www.domain.com -d domain.com

as arguments.

You can delete the existing and simply recreate a new certificate by passing both instances of your domain and then restarting Apache/NGINX.

  • You can delete the existing and simply recreate a new certificate by passing both instances of your domain

    Or don't delete anything, and run the original command modified to add --expand and, as you said, -d www.domain.com -d domain.com.

    • Still doesn't seem to work. Just gives me an error saying that it cant connect to www.domain.com. Maybe its something to do with Cloudflare? is there a way just to redirect any www requests to domain.com?

      Managed to setup the redirect on Cloudflare :)
      Cheers anyways guys!

Have another answer? Share your knowledge.