2

I tried to get Let's Encrypt certificates for both my www and non-www domain names, then redirect all the requests to https://www.afa-advisory.com/.

I installed certbot on my OVH VPS, then I tried many attempts to get both certificates:

1) I tried an all-in-one command: certbot --apache -d afa-advisory.com -d www.afa-advisory.com

2) I tried the domain names separately in two commands: certbot --apache -d afa-advisory.com certbot --apache -d www.afa-advisory.com

3) I tried expanding the first SSL certificate.

The problem is that I always get an invalid certificate for my root domain:

Invalid Common Name: Default Company Ltd

AFA Med
  • 597
  • 2
  • 6
  • 15
  • Check the certificate chain in your browser. It seems you may have a different certificate for that domain. – BillThor Sep 19 '16 at 04:40
  • I checked it, the common name is not correct, but that's what was generated with certbot, may be a bug ? – AFA Med Sep 19 '16 at 18:30

1 Answers1

2

A bit late, but did you try to generate certificate for both URL's?, by example:

  sudo certbot --apache -d mydomain.com,www.mydomain.com

I dont use:

  sudo certbot --apache -d mydomain.com -d www.mydomain.com

Because this last one, generate different certificate for each hostname.

JorgeM
  • 231
  • 2
  • 6
  • I'm confused. Both of those commands look the same. Are you suggesting that it is the correct command or the wrong command? – Todd Wilcox Dec 18 '17 at 21:57
  • @ToddWilcox I'm so sorry, it was badly written, thank you for report it – JorgeM Dec 19 '17 at 17:53
  • stange... for automating hosting management I use `certbot certonly --webroot --webroot-path /some/path -d domaine.com -d other.domaine.com,some.other.com` and it generates a single cert as this way I am sure it generates the cert in the folder /etc/letsencrypt/live/domaine.com – Antony Gibbs Nov 12 '18 at 21:47