I bought a Gandi.net SSL certificate and I'm following this tutorial.

  1. I created the key file.
  2. then transformed it to CSR
  3. then added it to Gandi website and waited for the CRT.
  4. then removed the password from the key ===> result : [FINAL KEY]
  5. then merged the CRT and the FINAL KEY into one file ==> result : [FINAL PEM]
  6. then heroku ssl:add final_pem final_key --app app_name

and... got Pem is invalid / Key doesn't match the Pem certificate.

I tried 3 times and I really don't know what's going one.

Can you help ?

link|improve this question
What's the .pem file look like now? (don't include the private key's data) – Shane Madden Jan 6 at 4:29
it containes a certificate and an RSA private key -----BEGIN CERTIFICATE----- MIIE6DCCA9CgAwIBAgIRANqDI....XXXXX.......-----END CERTIFICATE----- -----BEGIN RSA PRIVATE KEY----- MIIEowIBAAKCAQEAuEBA8IsNq2 ... XXXXXXXXXXX ......-----END RSA PRIVATE KEY----- – Jane Jan 6 at 4:32
Does it work if you don't remove the password from the key? What parameters in openssl did you use to strip the password from your key? Try just generating a key without a password in the first place and see if that works. – SimonJGreen Jan 7 at 16:56
feedback

2 Answers

I got my certs from another provider but I kept my public cert and private key in separate files and it worked.

link|improve this answer
feedback

I think I may have run into a similar issue when attempting to use a Gandi certificate on Heroku. Heroku kept on complaining that my PEM file didn't match my key, and running openssl x509 -noout -modulus -in example.com.crt gave me an "unable to load certificate" error.

The issue in my case was very simple: when I downloaded the certificate from Gandi, there was an extra blank line between the certificate text and the "--END CERTIFICATE..." line:

ghjg86GHHJ47Nmmmaiuoj8bUW8bbn/9w78sTxuguHQWjhuhuQWQhuybyyA==

-----END CERTIFICATE-----

When I deleted the blank line, everything worked perfectly:

ghjg86GHHJ47Nmmmaiuoj8bUW8bbn/9w78sTxuguHQWjhuhuQWQhuybyyA==
-----END CERTIFICATE-----

I think when you create the final PEM file that you want to concatenate your certificate and your CA's certificate, not your certificate and your private key:

cat example.com.crt certificate-issuer.com.pem > example.com.pem

Finally, I found http://blog.bloom.io/2011/09/16/https-ssl-table-stakes/ very helpful with the whole process.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.