Add new common name to Heroku ACM - ruby-on-rails

I have SSL working on my heroku app. I started using Heroku SSL and I'm now using Automatic Certificate Management. I'm in the process of migrating an app from one domain to another. www.firstdomain.com is working with SSL. However I'm now trying to add SSL to the new domain, seconddomain.com.
The error I'm receiving from chrome when navigating to the second domain is NET::ERR_CERT_COMMON_NAME_INVALID. This makes sense because the output of heroku certs:auto the Common Name(s) are: firstdomain.com, www.firstdomain.com, with no mention of seconddomain.com, despite the domain having a status of OK below.
Do I need to update the common name to include seconddomain.com?
If so, how do I do that using heroku certs?

Related

ERR_CERT_COMMON_NAME_INVALID when trying to get image from S3 with rails app on heroku

I'm getting the following error in the console when I try to get images from amazon S3, with my rails 5.2 app (with ActiveStorage) deployed on heroku:
GET https://www.myapp-production.herokuapp.com/rails/active_storage/representations/eyJfcmFpbHMiOnsibW[...]/image.jpeg net::ERR_CERT_COMMON_NAME_INVALID
I'm using heroku pipeline with 2 apps : myapp-staging (free dynos, no sll), and myapp-production(professional dyno + automatic ssl).
I've got a custom domain with ssl pointing to production app.
I can get images when I use the custom domain.
The problem occurs only when I use both staging/production.herokuapp.com/ domains.
Can't figure out what the problem is.
Thanks
If you expand the error info on the page, you'll get a more complete explanation:
This server couldn't prove that it's www.myapp-production.herokuapp.com; its security certificate is from *.herokuapp.com.
In certificates, a * only matches a single DNS label (e.g. containing no dots). So if you visit your app using myapp-production.herokuapp.com it will work, but to support navigating to the site with the www on the front, you will need to get a different certificate that includes the SubjectAltName *.myapp-production.herokuapp.com.
Thanks, that was de problem.
I was redirecting all request from non www to www subdomain to avoid duplicate content for SEO in my route file.
I turn it off for review and staging app and it's now working.
I don't really understand why the certificat was invalid only for images, though...

How to get SSL working on Rails app with Heroku?

I am trying to get SSL working on my Rails app that I am deploying with Heroku.
I have used the automated certificate management from Heroku and followed the directions, but when I visit my site I still see a “Not Secure” label in the URL bar. I am trying to figure out how to address this.
My site is at http://give.toacause.com/. When I use inspect in the chrome browser and go to Security, I read that the certificate is missing. However, when I click “view certificate”, I see a notice that “This certificate is valid.”
What step am I missing here?
It appears as though the CNAME record for give.toacause.com is mysterious-bastion-66058.herokuapp.com
You need to use *.herokudns.com.
heroku domains will output something like
Domain Name DNS Record Type DNS Target
give.toacause.com CNAME give.toacause.com.herokudns.com
You need to set the CNAME to the value of the DNS target field. After you do, make sure you flush your DNS cache so you can resolve and check it again, or use one of the many HTTPS checkers on the internet.

Heroku ACM not working

I have a RoR app hosted in Heroku and I'm trying to set my custom domains. In fact, I want three custom domains: www.myapp.org, www.myapp.eu and www.myapp.es.
I have configured my DNS to point to the DNS targets provided by Heroku. I have the .eu and .es domains registered in www.piensasolutions.com and the .org in cloudns.
The redirection works perfectly fine but I have discovered that ACM is unable to generate certificates for my .es domain. The other 2 work perfectly fine (.org and .eu) but the .es is failing. Even though is configured exactly the same as the .eu one, as they are both registered in the same site.
I have tried to see the status of the certifications using heroku certs:auto and it says "Failing" for the "www.myapp.es"
It was a matter of time. Seems like certificating a local domain like .es is slower for the Heroku ACM. After nearly 20h everything is set up. Sorry for the time waste.

Heroku: custom domains

I had set up my custom domain on Heroku and it was working. Then I decided I wanted to delete that app but use the same domain on another app. I tried switching it over, but I got error messages saying it was already in use.
Therefore, I decided to start from scratch. I went to Godaddy, reset the nameservers (changing them to other nameservers and then back to Zerigo/Heroku) so that they were now pointing fresh at Zerigo.
I then added the domain to this new app but when i run the following in the terminal to check that it's been added properly.
host www.mydomain.com
I get this error
www.mydomain.com has address 67.63.50.58
Host www.mydomain.com not found: 3(NXDOMAIN)
Host www.mydomain.com not found: 3(NXDOMAIN)
This addresss 67.63.50.58 is not the heroku/zerigo address.
However, I'm quite sure that I know how to set up a custom domain. For example, i tested another custom domain on this same app (a custom domain that I hadn't assigned anywhere else previously) and it's now working fine.
Anyone know how I can reuse this custom domain i.e. totally reset it. Or can you explain what that error message means?
If you get a message that the domain is already in use when you add the domain to a new app on Heroku that would suggest to me that when you deleted the application previously then for whatever reason Heroku did not delete the previous custom domains - you shouldn't have to change any DNS settings if the domain was already pointing at Heroku. I would contact support in this instance and tell them the scenario, they should be able to fix it.

heroku rails app domain only working without www

I moved an app from my existing ISP to heroku 2 days ago.
It seems like it wasn't working until I realized I had put railslinks.com instead if www.railslinks.com in the heroku web control panel interface.
So when I actually tried http://railslinks.com instead of http://www.railslinks.com it worked
So (today 1 hr ago) I added www.railslinks.com in the heroku control panel.
I made NO changes to my DNS settings with Network Solutions (which show all my various domains with the www prefix).
So far though, I'm not yet able to connect to http://www.railslinks.com
Is there a dns-like delay in getting my heroku change propogated or am I missing something.
Note: 'myapp' is not the actual name, just my placeholder in the document.
DNS Settings at Network Solutions:
Heroku Settings (I've put both of them there for now, tried www alone didn't help):
Found it, have to use my "zergio" dns editing tool:
Provided you have a CNAME entry for www.myapp.com pointing at either proxy.heroku.com or myappname.herokuapp.coun then it should work.
Adding domains is almost instant on Heroku, this sounds more like a DNS issue but without knowing your real domain makes it tough to diagnose.
For me this has worked out for www.reactjs.co (just add www. in the heroku app admin panel):
herokuapp fix - click here for the screenshot

Resources