Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trouble with Heroku SSL Endpoint

I am trying to add an SSL cert to Heroku. The cert was purchased from Network Solutions. I went through all of the steps and created a .csr file, uploaded that file to NetworkSolutions, downloaded their bundle of .crt files (MYSITE.crt, AddTrustExternalCARoot.crt, NetworkSolutionsDVServerCA.crt) and then combined the site cert & the intermediate certificate (AddTrustExternalCARoot.crt) bundles. When I try and add the final.crt file I produce to Heroku I get:

!    Expires at can't be blank
!    Pem is invalid

Using Preview I can clearly see that "Not Valid After" is set so I am not really sure what is going on here.

For what its worth I also tried combining NetworkSolutionsDVServerCA.crt with MYSITE.CRT & also combining all 3. All with no luck.

This kind of thing isn't my strong point (I am sure you can tell) so its very possible I am missing something but if you have any ideas on what it might be I would appreciate it.

Thanks

like image 743
Brent Avatar asked Jun 20 '12 18:06

Brent


1 Answers

I faced the same problem today.

Below are the steps I followed to fix it.

  1. Combine the certificate files in the below order (from the site certificate to root certificate) into a .crt or .pem file. Lets assume you name it Mysite_combined.crt.

    MySite.crt, NetworkSolutionsDVServerCA.crt, AddTrustExternalCARoot.crt

  2. Open Mysite_combined.crt the content of the file will look like

    -----BEGIN CERTIFICATE-----
    ..
    -----END CERTIFICATE----------BEGIN CERTIFICATE-----
    ..
    -----END CERTIFICATE----------BEGIN CERTIFICATE-----
    

Now, Insert line feed between each certificate. Make sure there is no white space or blank line in the edited file. The content should now look like

-----BEGIN CERTIFICATE-----
..
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
..
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
  1. Now add the certificate to Heroku using the command

    heroku certs:add Mysite_combined.crt Mysite.key

Note: Since Network solution certificate does not have a pass code, you can ignore the steps to remove pass code in heroku site. If you use a key which has pass code refer to this article which details how to setup the SSL for heroku. You should do the step 2 above in any case.

like image 159
Yogesh P Avatar answered Oct 21 '22 20:10

Yogesh P