Using 1and1, heroku, www domain does not have ssl - ssl

I have a website hosted on heroku. I purchased hobby and now it has ssl. On 1and1 I point root domain to https:// address and ssl works fine. On www domain there is no ssl. I added ssl herokudn address to CNAME for www subdomain on 1and1. Does not work. What can I do?

The problem was with Rails. On production.rb you must uncomment config.force_ssl = true

Related

Why is my IONOS 1&1 root not redirecting correctly over ssl?

I have a 1&1 IONOS domain for my heroku app. the www subdomain works fine, with a CNAME setup for it. but I'm trying to redirect the root url to the www subdomain. this also works fine for http, but if the url is typed in as https://example.com, I get a ERR_SSL_PROTOCOL_ERROR (on chrome, other browsers have different errors). this is on any device, regardless of clearing cache and history etc.
my heroku logs show it's never reached, so it must be an issue within 1&1.
theres an ssl cert set on the domain with 1and1, as well as heroku's ACM.
any ideas?
To make the four URL variations (http://example.com, http://www.example.com, https://example.com, and https://www.example.com) point to a different SSL hosted site (heroku, cloudfront, etc), you need three things in IONOS:
Under DNS settings, add a CNAME entry for the www subdomain that points to your SSL hosted site (example.herokuapp.com)
Set up an HTTP Redirect under Domain Forwarding to https://www.example.com (don't check the box that states "Also set up for www subdomain")
Make sure you have an SSL wildcard certificate for *.example.com installed and attached to your domain in IONOS
It looks like all you are missing is number 3. After that, the redirect that you have setup should work as expected.
Note: example.com should be replaced by your actual domain in all of the above.

Heroku custom domain ssl name mismatch error

I've added a custom domain (bought on GoDaddy) to my Heroku app and am on the hobby dyno. When I type in www.example.com everything works fine, but when I open example.com I get a name mismatch error.
My cname host www points to example-78914389.herokudns.com and I have forward to https://www.example.com on GoDaddy enabled.
The certificate is only valid for the following names: shortener.secureserver.net, www.shortener.secureserver.net.
Why is the certificate valid for these domains and not for my example.com?
I don't know if it matters, but I just ported the domain from zeit now to GoDaddy.
Problem solved!
I transferred my domain from GoDaddy to namecheap, then made an ALIAS record. I've also added example.com to my app in Heroku. I now have www.example.com and example.com added and both domains work.
If you have the same issue, check this out: https://devcenter.heroku.com/articles/custom-domains#add-a-custom-root-domain

Setting up SSL on Domain.com

I currently have a domain from domain.com. I have a heroku domain name and a dns target. I have also enabled the free ssl on domain.com.
Example:
Heroku: domain: www.test.com DNS Target: crazytarget.herokudns.com
Domain.com: Record: CNAME, Name: WWW, Content: crazytarget.herokudns.com
Note: This works for non-https.
I uploded a .htaccess file onto heroku so now the heroku domain is served at https://path.herokuapp.com.
This domain name cname does NOT pick up the https version of the site.
My question is: How do I get my domain to use https? I dont see how to do this anywhere.
I had to setup SSL on the Heroku end. :(

Heroku naked domains with DNS & SSL

I've been struggling with the configuration of my DNS app on Heroku. Things I want to accomplish:
www.example.com and example.com , both with SSL config (HTTPS)
Things I tried so far ...
GoDaddy Settings:
CNAME | www | example.com.herokudns.com
FOWARDING to
https://www.example.com
However, this setup is working great with HTTP only, but I'm getting a "Your connection is not private" error when I type the https.
I checked several tutorials and none address this issue.
PS: I'm using the SSL automatically managed from heroku.
SOLVED IT
Getting the naked domain set up with Godaddy easily: Set forwarding to your domain: https://www.my-domain.com. This will redirect non www to the correct place.
With that, I don't actually need to add a second domain in heroku (example.com).
Just keep the www.example.com, turn the SSL on, go to go daddy and redirect. This is working for me so far....

How to handle two domains and forward everything (non www and www) to one Heroku app?

I have 2 domains, one at Register.com and one at Godaddy. I need them both to point to one Heroku app, and the following scenarios to work:
http://domain1.com
http://domain2.com
http://www.domain1.com
http://www.domain2.com
https://domain1.com
https://domain2.com
https://www.domain1.com
https://www.domain2.com
All of the above should all end up at one heroku app at https://www.domain1.com
Being that it's Heroku, I have no access to the .htaccess, and I've heard you're only allowed one SSL cert per app. I also have forwarding setup at GoDaddy, but apparently forwarding does not work if you try to forward from https on a non-hosted app.
Your cert has to match the domain name that the client will try to answer, this means that when you make it the Subject Alternative Names (SANs) have to include www.domain1.com, domain1.com, www.domain2.com, domain2.com, and the domain/ip of your actual heroku app.
For your DNS records, if the heroku app is at a Fully Qualified Domain Name (FQDN), and not an ip then follow these steps:
Forward your root domain, e.g. example.com to www.example.com, and make the CNAME record www. 300 IN CNAME domain.of.heroku.app
If the heroku app is reachable at a static ip follow this:
Make an the following A records for both your domains:
# 300 IN A ip-here