Heroku SSL error: key does not match PEM certificate

I am trying to create a self-signed certificate using the instructions Heroku offers here: http://www.akadia.com/services/ssh_test_certificate.html

This creates sever.key and server.crt.

Then I will try to add them to the hero using the following command:

heroku ssl: add server.crt server.key and i get the following error

Domain name not found. Make sure the domain mycorrectdomain.heroku.com is added to your application / Heroku key does not match the PEM certificate.

Here is the contents of the server.crt file:

-----BEGIN CERTIFICATE----- MIICvTCCAiYCCQDyHGnBdtovbzANBgkqhkiG9w0BAQUFADCBojELMAkGA1UEBhMC VVMxCzAJBgNVBAgMAkNBMRIwEAYDVQQHDAlQYWxvIEFsdG8xEzARBgNVBAoMClR1 dG9yQ2xvdWQxETAPBgNVBAsMCFNvZnR3YXJlMSMwIQYDVQQDDBp0ZXN0LXR1dG9y Y2xvdWQuaGVyb2t1LmNvbTElMCMGCSqGSIb3DQEJARYWYmxhaXJAbXl0dXRvcmNs b3VkLmNvbTAeFw0xMTA4MDMxNzQ4NDdaFw0xMjA4MDIxNzQ4NDdaMIGiMQswCQYD VQQGEwJVUzELMAkGA1UECAwCQ0ExEjAQBgNVBAcMCVBhbG8gQWx0bzETMBEGA1UE CgwKVHV0b3JDbG91ZDERMA8GA1UECwwIU29mdHdhcmUxIzAhBgNVBAMMGnRlc3Qt dHV0b3JjbG91ZC5oZXJva3UuY29tMSUwIwYJKoZIhvcNAQkBFhZibGFpckBteXR1 dG9yY2xvdWQuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCqWEjXRDo0 CBzoIqnpzPN6Ussf476JDX+9uCkpaSyR6Oxarjpc55lw+Mnb9UNiBWPS6JJ/Hq2c CgkGD9uu11OXRCRvsZeyJjd2YT1B+XZsXrKZVj2C2dj1r6DXzAV2G5EwWJDklaH3 x1uA+muPt7NZ4Dz2WNv9FMyicTTCdMhWlwIDAQABMA0GCSqGSIb3DQEBBQUAA4GB AJYAgjiHyUxyeFRR2nJ3CLanjNtkzVz+Dk7pdu/p0P35YpYhE95q76xgcOFasWe2 +pUwxTjtQvhc0BRHjohSjiF8+ZFLRfsPq9kmh55AFzDj7V8dzUek4yVyZRtcIdNQ Gx8I5g8vJClLnHbYQlaCupVIxVZqnp7SKeeshduCsJ/8 -----END CERTIFICATE----- 

Any ideas?

+3
source share
2 answers

Just in case, if others get this error - I got the same error as the SSL certificate for the test name for my application.

The answer was that I did not add the domain name for which the first certificate was for - this does not explain this in Heroku SSL docs. Therefore, before adding the certificate, do:

 heroku domains:add secure.mydomain.com 

and then you can add a certificate:

 heroku ssl:add ssl.crt ssl.key 
+6
source

Have you added an SSL addon in the settings of your heroku application?

In addition, you should not publish your private key online, as it should be ... well ... private.

I suggest you create a new key pair for your application.

EDIT:

You mentioned that you turned on the piggyback protocol, in which case you do not need to create your own keys. See this :

Piggyback SSL does not require a special SSL certificate for the application. * .heroku.com SSL wildcard certificate is used for all applications. You can view information about this certificate by visiting https://heroku.com/ and clicking the lock icon in your browser.

+3
source

All Articles