Registry / gcp / google-cloud-certificate-manager

google-cloud-certificate-manager

JSON →
library1.14.0pypypi✓ verified 84d ago

The `google-cloud-certificate-manager` library is the official Python client for the Google Cloud Certificate Manager API. It allows developers to programmatically acquire and manage TLS (SSL) certificates for use with Cloud Load Balancing. Currently at version 1.13.0, it is part of the larger `google-cloud-python` monorepo, which undergoes frequent updates, ensuring ongoing feature development and maintenance.

pip install google-cloud-certificate-manager
INSTALL
IMPORT
SIG · GOOGLE-CLOUD-CERTI
G
google-cloud-certificate-manager
gcppythonv1.14.0
Install
5.3s avg
Import
1791ms
Disk
68MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.14.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 2.083s · 69.4MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 5.3s · import 1.499s · 67MB
68MB installed
● package 68MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

CertificateManagerClient
from google.cloud import certificate_manager_v1
from google.cloud.certificate_manager import CertificateManagerClient
The client class is typically exposed under a versioned submodule (e.g., `_v1`) to allow for API versioning.

This quickstart demonstrates how to initialize the `CertificateManagerClient` and list existing certificates within a specified Google Cloud project and location. Ensure your `GOOGLE_CLOUD_PROJECT` environment variable is set or replace 'your-project-id' with your actual project ID. Authentication is handled automatically via Application Default Credentials (ADC) if configured.

import os from google.cloud import certificate_manager_v1 # Set your Google Cloud Project ID project_id = os.environ.get('GOOGLE_CLOUD_PROJECT', 'your-project-id') location = 'global' # Certificate Manager resources are often global def list_certificates(): client = certificate_manager_v1.CertificateManagerClient() parent = client.common_location_path(project_id, location) print(f"Listing certificates in project {project_id} in location {location}:") try: for certificate in client.list_certificates(parent=parent): print(f"- Certificate: {certificate.name} (DNS names: {', '.join(certificate.managed.dns_authorizations or ['N/A'])})") except Exception as e: print(f"Error listing certificates: {e}") if __name__ == "__main__": list_certificates()
Debug
Known issues
breakingThis library requires Python 3.9 or newer. Running on older Python versions (e.g., 3.8 or below) will result in installation failures or runtime errors.
fix
Upgrade your Python environment to 3.9 or higher.
affects: <1.0.0 (though current requires >=3.9)
gotchaAuthentication must be set up correctly for the client to interact with Google Cloud services. Without proper authentication (e.g., Application Default Credentials, service account key, or `GOOGLE_APPLICATION_CREDENTIALS` environment variable), `google.auth.exceptions.DefaultCredentialsError` or similar authentication errors will occur.
fix
Refer to Google Cloud's authentication documentation for Python client libraries to configure Application Default Credentials or explicitly provide credentials to the client.
affects: All versions
gotchaThe Certificate Manager API must be explicitly enabled in your Google Cloud project for the client library calls to succeed. If the API is not enabled, you will receive `PERMISSION_DENIED` errors.
fix
Navigate to the Google Cloud Console, search for 'Certificate Manager API', and ensure it is enabled for your project.
affects: All versions
gotchaWhen using `CertificateManagerClient` as a context manager (`with certificate_manager_v1.CertificateManagerClient() as client:`), be aware that exiting the `with` block will close the underlying transport. This can cause issues if the transport object is shared with other client instances.
fix
Only use the client as a context manager if the transport is not shared. For long-running applications or shared transports, initialize the client outside a `with` statement and explicitly close the client's transport when no longer needed using `client.close()`.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'google.cloud.certificate_manager'
The `google-cloud-certificate-manager` library or its parent `google-cloud` package is not installed or not accessible in the current Python environment.
fix
Ensure the library is installed using pip: `pip install google-cloud-certificate-manager`
provisioningIssue: reason: AUTHORIZATION_ISSUE
The Google-managed certificate provisioning or renewal failed because of issues with domain ownership verification, often related to DNS records or load balancer configuration.
fix
Check the detailed `authorizationAttemptInfo` for specific `failureReason` (e.g., `CONFIG`) and ensure DNS A/AAAA records point to the load balancer, CNAME records are correctly configured for DNS authorization, or CAA records permit Google to issue certificates.
CNAME_MISMATCH
This error occurs during DNS authorization when the expected CNAME record for domain verification does not match the resolved CNAME record in your DNS configuration.
fix
Verify and correct the CNAME record in your DNS configuration to exactly match the value provided by Certificate Manager for domain authorization.
Certificate cannot be parsed
The self-managed SSL certificate file provided to Certificate Manager is not in the correct PEM format, contains invalid data, or has an issue with its structure.
fix
Ensure the certificate is in PEM format and is valid. You can use OpenSSL to validate the certificate (e.g., `openssl x509 -in CERTIFICATE_FILE -text -noout`) and ensure no extraneous characters like newline characters are present.
Upgrade
Version history
1.14.0latest on PyPI · released Jun 3, 2026
Audit
Dependencies
google-api-corerequiredCore library for Google API clients, handling requests, retries, and pagination.
google-authrequiredHandles authentication with Google Cloud services.
proto-plusrequiredProvides a Pythonic interface for Protocol Buffer messages.
Agent activity
19 hits · last 30 days
node
18
OpenAI (training)
1
Resources
google-cloud-certificate-manager — pip install google-cloud-certificate-manager · libregistry