Bird
0
0

You run gcloud compute ssl-certificates create my-cert --certificate=cert.pem --private-key=key.pem but get an error stating the certificate is invalid. What is a likely cause?

medium📝 Debug Q6 of 15
GCP - Cloud Load Balancing
You run gcloud compute ssl-certificates create my-cert --certificate=cert.pem --private-key=key.pem but get an error stating the certificate is invalid. What is a likely cause?
AThe certificate file is not in PEM format or the private key does not match the certificate.
BThe Google Cloud project is not set correctly in gcloud CLI.
CThe SSL certificate name already exists in the project.
DThe gcloud CLI version is outdated.
Step-by-Step Solution
Solution:
  1. Step 1: Check certificate and key format

    SSL certificates and private keys must be in PEM format and the key must correspond to the certificate.
  2. Step 2: Understand error cause

    An invalid certificate error often means the files are malformed or mismatched.
  3. Final Answer:

    The certificate file is not in PEM format or the private key does not match the certificate. -> Option A
  4. Quick Check:

    Certificate and key must match and be PEM formatted [OK]
Quick Trick: Certificate and key must match in PEM format [OK]
Common Mistakes:
  • Assuming project misconfiguration causes certificate errors
  • Thinking duplicate names cause invalid certificate errors
  • Blaming CLI version for certificate format issues

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More GCP Quizzes