Search code examples
sslgoogle-cloud-platformgoogle-compute-enginegoogle-cloud-load-balancer

Setting up an SSL cert with Google Cloud Load Balancer


I'm trying to setup google cloud load balancer for SSL using a certificate (PositiveSSL) that I generated via a certificate authority.

Via the google cloud shell, here is how I generated the key:

openssl genrsa -out my-key.key 2048

And here is how I generated the CSR (certificate signing request):

openssl req -new -key my-key.key -out my-csr.csr

I then used the CSR to obtain the SSL cert from the certificate authority, and I received the following two files:

  1. my-crt.crt
  2. my-ca-bundle.ca-bundle

All tolled, I have the following four files:

  1. my-key.key
  2. my-csr.csr
  3. my-crt.crt
  4. my-ca-bundle.ca-bundle

The image shown below is the form for creating an SSL cert in Google Cloud Load Balancer:

enter image description here

Can you please direct me as to what information goes where (from the files I have at my disposal). I don't have any files that are in .pem format.


Solution

    • my-crt.crt is the public key certificate

    • my-key.key is the private key to your certificate

    • my-ca-bundle.ca-bundle is your certificate chain

    Open those files up, copy and paste the content to the form.

    This is described in GCP documentation on "Creating and Using SSL Certificates" under the section "Creating an SSL certificate resource from existing certificate files" as per the doc

    • In the Public key certificate field, click the Upload button to upload your .crt file or paste the entire contents of your .key file into the field, including the -----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- that enclose the file contents.
    • In the Certificate chain field, click the Upload button to upload your .csr file or paste the entire contents of the .csr file into the field, including the -----BEGIN CERTIFICATE REQUEST----- and -----END CERTIFICATE REQUEST----- that encloses the file contents.
    • In the Private key certificate field, click the Upload button to upload your private key, using the .key file generated previously. This file uses, for example, -----BEGIN RSA PRIVATE KEY----- and -----END RSA PRIVATE KEY----- to enclose the file contents.