I am following the instructions on https://devcenter.heroku.com/articles/ssl-endpoint but getting stuck on generating private key. It says to generate a private key '$ openssl genrsa -des3 -out server.pass.key 2048' so I'm typing into rails command line
$ heroku run openssl genrsa -des3 -out server.pass.key 2048
This seems to work and I can enter a passphrase twice (but there is no confirmation message)
The next stage is to type the following "$ openssl rsa -in server.pass.key -out server.key" – so that the private key can be stripped of its passphrase. So:
$ heroku run openssl rsa -in server.pass.key -out server.key
But here I get the following error:
Error opening Private key server.pass.key
2:error:02001002:system library:fopen no such file or directory:bss_file.c:356:f
open('server.pass.key','r')
2:error:20074002:BIO routines:FILE CTRL:system lib:bss_file.c:358:
Unable to load private key
Any ideas? Thanks.
(by the way I already have site-wide SSL enabled on the app, using heroku's certificate. I am trying to change to my own SSL certificate for my own domain).
Best Answer
I think the idea is to run those commands locally, on your own computer. First, make sure you have
openssl
installed (if you don't, follow the instructions on the provided Heroku help page, or use a friend's computer that has it installed). Then, type this:After this step, there should be a file named
server.pass.key
in the current directory:Then, run the second command:
After you finish this step, there should be two files in the directory. Then, continue as it says in instructions.