{"id":6656,"library":"google-cloud-certificate-manager","title":"Google Cloud Certificate Manager","description":"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.","status":"active","version":"1.13.0","language":"en","source_language":"en","source_url":"https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-certificate-manager","tags":["google cloud","certificate management","pki","tls","ssl"],"install":[{"cmd":"pip install google-cloud-certificate-manager","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Core library for Google API clients, handling requests, retries, and pagination.","package":"google-api-core"},{"reason":"Handles authentication with Google Cloud services.","package":"google-auth"},{"reason":"Provides a Pythonic interface for Protocol Buffer messages.","package":"proto-plus"}],"imports":[{"note":"The client class is typically exposed under a versioned submodule (e.g., `_v1`) to allow for API versioning.","wrong":"from google.cloud.certificate_manager import CertificateManagerClient","symbol":"CertificateManagerClient","correct":"from google.cloud import certificate_manager_v1"}],"quickstart":{"code":"import os\nfrom google.cloud import certificate_manager_v1\n\n# Set your Google Cloud Project ID\nproject_id = os.environ.get('GOOGLE_CLOUD_PROJECT', 'your-project-id')\nlocation = 'global' # Certificate Manager resources are often global\n\ndef list_certificates():\n    client = certificate_manager_v1.CertificateManagerClient()\n    parent = client.common_location_path(project_id, location)\n\n    print(f\"Listing certificates in project {project_id} in location {location}:\")\n    try:\n        for certificate in client.list_certificates(parent=parent):\n            print(f\"- Certificate: {certificate.name} (DNS names: {', '.join(certificate.managed.dns_authorizations or ['N/A'])})\")\n    except Exception as e:\n        print(f\"Error listing certificates: {e}\")\n\nif __name__ == \"__main__\":\n    list_certificates()","lang":"python","description":"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."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or higher.","message":"This 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.","severity":"breaking","affected_versions":"<1.0.0 (though current requires >=3.9)"},{"fix":"Refer to Google Cloud's authentication documentation for Python client libraries to configure Application Default Credentials or explicitly provide credentials to the client.","message":"Authentication 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.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Navigate to the Google Cloud Console, search for 'Certificate Manager API', and ensure it is enabled for your project.","message":"The 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.","severity":"gotcha","affected_versions":"All versions"},{"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()`.","message":"When 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.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-15T00:00:00.000Z","next_check":"2026-07-14T00:00:00.000Z","problems":[]}