Generate certificate ssl for gcp instance with dynamic hostname

1.8k Views Asked by At

We have set up a gcp load balancer which transfers the requests received to the backend service. The load balancer is accessible in HTTPS. We want to make the backend accessible in HTTPS by other internal services. As the service is part of the gcp instance group, the instance name is not fixed. It is of the form hostname-<dynamic_suffix>. How can I generate an ssl certificate for a dynamic hostname? PS: We cannot have a certificate with a wildcard hostname-*

1

There are 1 best solutions below

0
On

Using self-managed SSL certificates - follow below steps.

Step 1: Create a private key and certificate.

You can do this locally using:

$ openssl genrsa -out PRIVATE_KEY_FILE 2048

Ensure you create a CSR and Sign it.

Step 2: Create a self managed certificate resource in cloud console - From a cloud shell, use the gcloud command. Also at the end I would say for additional information for each step, please see the complete guide.

I referred to the documents for the Generation of certificate ssl for gcp instance with dynamic host name.