Skip to content

Instantly share code, notes, and snippets.

@cjolly
Last active August 6, 2016 21:44
Show Gist options
  • Save cjolly/3165095 to your computer and use it in GitHub Desktop.
Save cjolly/3165095 to your computer and use it in GitHub Desktop.
How to use Heroku's SSL Endpoint with an SSL certificate purchased from GoDaddy

How to use Heroku's SSL Endpoint with an SSL certificate purchased from GoDaddy.

Create a Private Key

https://devcenter.heroku.com/articles/csr

openssl genrsa -des3 -out server.orig.key 2048
openssl rsa -in server.orig.key -out server.key

Generate a Certificate Signing Request

openssl req -new -key server.key -out server.csr

Request Certificate from GoDaddy

  • Select Apache (2.0) as the web server when downloading
  • Unpack download into same dir as keys above
  • Combine root CA certificate
cat mydomain.com.crt gd_bundle.crt > final.crt

Add cert to heroku for use with ssl:endpoint

heroku certs:add final.crt server.key
# or if you're updating an existing 
heroku certs:update final.crt server.key
@agilous
Copy link

agilous commented Aug 15, 2013

Thanks for this although I received an "Invalid Public Key Certificate" error from Heroku when I followed these steps. I followed the step for creating the PEM file here to create the bundle.pem file given in Heroku's docs here.

cat server.key server.crt gd_intermediate.crt > bundle.pem
heroku certs:add server.crt bundle.pem server.key

@cjolly
Copy link
Author

cjolly commented Aug 27, 2013

@agilous thanks for the update. Yeah, the heroku docs have gotten considerably better since I wrote this up last year. I should update this to reflect that.

@seenickcode
Copy link

Hello guys. I just got all this to work but realized the heroku docs may want to cite to include the bundle.pem file (the command @agilous ran above).

This is where I was looking (where it mentions "heroku certs:add server.crt server.key") https://devcenter.heroku.com/articles/ssl-endpoint

Thanks,

@cjolly
Copy link
Author

cjolly commented Apr 8, 2014

Anyone visiting after googling for this after #heartbleed - Heroku's article on this is finally pretty good. I suggest following their instructions here:

https://devcenter.heroku.com/articles/ssl-endpoint

Godaddy now has an nginx option as well. I'll update this gist to reflect all this after my sites are locked back down :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment