0
votes

Im having alot of trouble getting a ssl certificate working on a domain that i purchase in Namecheap.

I have a Node Application running in Heroku.

My DNS configuration in Namecheap:

  1. CNAME Record @ myapp.herokuapp.com. 1 min

  2. CNAME Record www myapp.herokuapp.com. 1 min

  3. URL Redirect Record @ https://www.myapp.herokuapp.com. Unmasked

  4. URL Redirect Record www https://www.myapp.herokuapp.com. Unmasked

My DNS configuration in Heroku:

  1. *.mywebsite.com

  2. mywebsite.com

  3. www.mywebsite.com

Till this point everything works fine. The problem is that i get a invalid certificate.

So i went to heroku, added a SSL certificate i got on NameCheap, and installed it there with the Key, CA and CRT. In heroku it shows the following confirmation:

Your certificate mywebsite.com expires on March 15, 2021.

The problem is, on https://www.mywebsite.com i still get the certificate from heroku, like so:

*.herokuapp.com Digicert SHA2 High assurance server CA

this turns the certificate from https://mywebsite.com invalid, i think because, the hostname ( mywebsite.com) does not have the same certificate as bieng showed (im talking about the *.herokuapp.com Digicert SHA2 High assurance server CA )

1

1 Answers

0
votes

So after some time, and since nobody awnsered i found out what to do:

Go to your heroku app settings menu, here you need to do two things:

  1. add your manually your ssl bought in NameCheap (or other) to the heroku ssl. Put the crt and key there. You should see an confirmation with your certificate and domain like it was seen in the question that i did.

  2. add the following domains: mywebsite.com and www.mywebsite.com

Go to NameCheap and add this to your Advanced DNS options:

CNAME Record www radiant-muskmeln-li2a31hh75z5u010t3likcwk.herokudns.com. 1 min

(the CNAME record above is the dns link that you get when you add a domain in heroku! dont put the myapp.herokuapp.com , it does not work)

URL Redirect Record @ https://www.mywebsite.com Unmasked

URL Redirect Record www https://www.mywebsite.com Unmasked

It takes time to work! restart your computer and run ipconfig /flushdns in windows console cmd.

i hope this helps someone, i lost so much time with this.

the result can be seen here : https://www.springstock.com