I bought an SSL certificate from godaddy.com. My website is hosted on Google Cloud Portal (GCP). I generated the private rsa key using the methods provided on the GCP support website.

First I generated a private key and a CSR using the below commands

openssl req -new -newkey rsa:2048 -nodes -keyout yourdomain.key -out yourdomain.csr

Then i created an rsa key for google cloud platform

openssl rsa -in yourdomain.key -out yourdomain.key.pem

Then I copied the csr text to godaddy and generated a certificate. From the merchant site, I downloaded the certificate. Before downloading the certificate, there was an option to select 'Server Type'. Following options were present:

  • Apache
  • Exchange
  • IIS
  • Mac OS X
  • Tomcat
  • Other

I selected "Other" and clicked 'Download'. A zip file was downloaded that had two files:


To install the certificate, I went to GCP App Engine > Settings > SSL Certificate > Upload a new Certificate. There are two text boxes:

  1. PEM encoded X.509 public key certificate
  2. Unencrypted PEM encoded RSA private key

I copied the RSA private key from step-1, into the 2nd text box. Now the problem is that the 1st text box (where I have to enter the public key) is not accepting any of the files present in the certificate zip folder that I downloaded from the merchant site. I get the error

The Certificate data is invalid. Please ensure that the private key and public certificate match

I tried copying either of the files to the 1st text box. I also copied both the file texts into the box. But nothing is working. Please help!

  • The proper way to go is to copy both files into the "PEM encoded X.509 public key certificate" field (in the order that you posted in your question). Can you do it again making sure that you paste it without any extra spaces between the files? – arudzinska Jun 25 '18 at 10:55
  • Thanks @AniaRudzińska, I copied both the crt files into a single notepad file making sure there aren't any extra spaces and made that notepad file extension as .pem and then used that file. It worked. – Rahul Singh Jun 27 '18 at 14:15
  • Great! I'll post it as an answer then. Please consider accepting & upvoting. – arudzinska Jun 27 '18 at 14:40

The proper way to go is to copy both files into the "PEM encoded X.509 public key certificate" field in the order that you posted in your question:


The important part is to make sure that there are no extra spaces between both files.

An alternative is creating in the same way a separate .pem file consisting of the two above and uploading it in the Cloud Console.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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