Ignasi
Ignasi

Reputation: 6185

Heroku SSL using self signed certificate

Following steps of: https://devcenter.heroku.com/articles/ssl-endpoint I have added SSL Endpoint add-on into my server hosted on Heroku.

Then, I've created a self signed certificate following: https://devcenter.heroku.com/articles/ssl-certificate-self

At this point I have upload my self-signed cert and private key using:

heroku certs:add server.crt server.key

In fact it gaves me:

 !    Unable to parse certificate. Please ensure the certificate is in PEM format.

But I found a simple solution on Google:

openssl rsa -in server.key -out server.key.rsa

Then I 've uploaded all:

heroku certs:add server.crt server.key.rsa
Resolving trust chain... done
Adding SSL Endpoint to <myapp>... done
<myapp> now served by wakayama-xxxx.herokussl.com
Certificate details:
Common Name(s): <mydomain>
Expires At:     2016-09-29 11:24 UTC
Issuer:         /C=AU/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<mydomain>
Starts At:      2015-09-30 11:24 UTC
Subject:        /C=AU/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<mydomain>
SSL certificate is self signed.

So if I ask for my certificates into Heroku I get:

heroku certs:info
Fetching SSL Endpoint wakayama-xxxx.herokussl.com info for <myapp>... done
Certificate details:
Common Name(s): <mydomain>
Expires At:     2016-09-29 11:24 UTC
Issuer:         /C=AU/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<mydomain>
Starts At:      2015-09-30 11:24 UTC
Subject:        /C=AU/ST=Some-State/O=Internet Widgits Pty Ltd/CN=<mydomain>
SSL certificate is self signed.

So seems that all is ok. Except... if I go to wakayama-xxxx.herokussl.com I see the message: "Heroku | No such app", hum, I've guess It should me redirect to my app, but not.

Any ideas?

Upvotes: 3

Views: 2517

Answers (1)

Ignasi
Ignasi

Reputation: 6185

Seems like: Heroku SSL Endpoint - "No Such App"

So I've closed my eyes and I've changed my DNS to add a CNAME pointing to wakayama-xxxx.herokussl.com (which doesn't redirect to app) and magically now HTTPS works. If someone can explain what's happening here I would appreciate.

Upvotes: 2

Related Questions