使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
问题排查
本页介绍了如何解决证书颁发机构服务的常见问题。
API 请求返回 HTTP 403 Forbidden
如果 API 请求返回 HTTP 403 Forbidden 并包含消息 Read access to project PROJECT_NAME was denied
,请使用以下解决方案。
解决方法
- 检查请求者的 IAM 权限。
- 检查请求的位置。不受支持的区域可能会返回权限遭拒错误。如需详细了解受支持的位置,请参阅位置。
删除 CA 时返回 HTTP 412 前提条件失败
如果您在删除 CA 时看到以下失败的预条件错误,请使用本部分中的解决方法。
Cannot perform Certificate Authority deletion, Certificate Authority is in state ENABLED.
解决方法
CA 需要处于 DISABLED
或 STAGED
状态才能被删除。请先确保您的 CA 处于正确状态,然后再安排删除。如需详细了解 CA 状态,请参阅 CA 状态。
证书颁发失败
CA Service 提供了多项政策控制功能,可用于管理证书颁发。如需详细了解政策控件,请参阅证书模板和签发政策概览。
证书签发可能会因多种原因而失败。其中一些原因如下。
CA 池的证书颁发政策与证书模板之间存在冲突。
例如,假设签发政策定义了扩展程序 foo
并为其分配了值 bar
,而证书模板定义了扩展程序 foo
并为其分配了值 bat
。为同一扩展程序分配两个不同的值会导致冲突。
解决方法
对照证书模板检查 CA 池的证书颁发政策,并找出并解决冲突。
如需详细了解颁发政策,请参阅向 CA 池添加证书颁发政策。
证书模板或 CA 池的证书颁发政策中的主题或主题备用名称 (SAN) 未通过 CEL 表达式评估。
解决方法
查看 CA 池的证书颁发政策和证书模板,并确保主题和 SAN 满足通用表达式语言 (CEL) 表达式设置的条件。如需详细了解 CEL 表达式,请参阅使用通用表达式语言。
为使用情形授予的 IAM 角色不正确。例如,为反射身份分配 roles/privateca.certificateRequester
角色,或为默认身份模式分配 roles/privateca.workloadCertificateRequester
角色。
解决方法
确认您已为默认身份模式分配 roles/privateca.certificateRequester
角色,并为反映的身份分配 roles/privateca.workloadCertificateRequester
角色。如需详细了解如何使用身份反射,请参阅适用于联合工作负载的身份反射。
尝试在不受支持的场景(例如没有 Hub 工作负载身份)中使用反射身份模式。身份反射不支持的场景会返回以下错误消息:
Could not use the REFLECTED_SPIFFE subject mode because the caller does not have a SPIFFE identity. Please visit the CA Service documentation to ensure that this is a supported use-case.
解决方法
确定您需要使用哪种类型的身份:默认身份或反映的身份。如果您需要使用反射身份,请确保您是在某种受支持的场景中使用它。如需详细了解身份反射,请参阅联合工作负载的身份反射。
默认密钥大小限制会拒绝模数大小小于 2048 位的 RSA 密钥。
业界最佳实践建议使用至少 2048 位的 RSA 密钥。默认情况下,CA 服务会阻止使用模数大小小于 2048 位的 RSA 密钥颁发证书。
解决方法
如果您想使用模数大小小于 2048 位的 RSA 密钥,则必须使用证书颁发政策明确允许使用此类密钥。您可以使用以下 YAML 示例来允许使用此类 RSA 密钥:
allowedKeyTypes:
- rsa:
minModulusSize: 1024
后续步骤
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-09-02。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-02。"],[[["\u003cp\u003eThis page provides solutions for common issues encountered with Certificate Authority Service, including API errors, CA deletion problems, and certificate issuance failures.\u003c/p\u003e\n"],["\u003cp\u003eAn HTTP 403 Forbidden error on API requests can be resolved by checking the requester's IAM permissions and ensuring the request location is supported.\u003c/p\u003e\n"],["\u003cp\u003eTo delete a CA, it must be in the \u003ccode\u003eDISABLED\u003c/code\u003e or \u003ccode\u003eSTAGED\u003c/code\u003e state, otherwise you will get an HTTP 412 error, so you must ensure the CA's state before attempting deletion.\u003c/p\u003e\n"],["\u003cp\u003eCertificate issuance failures may arise from conflicts between CA pool policies and certificate templates, incorrect IAM role assignments, or unsupported identity reflection scenarios, which can all be resolved by reviewing and correcting those settings.\u003c/p\u003e\n"],["\u003cp\u003eCertificate issuance can be blocked if the RSA key's modulus size is less than 2048 bits, but you can explicitly allow smaller keys through the certificate issuance policy.\u003c/p\u003e\n"]]],[],null,["# Troubleshooting\n===============\n\nThis page shows you how to resolve common issues with Certificate Authority Service.\n\nAPI request returns HTTP 403 Forbidden\n--------------------------------------\n\nIf an API request returns HTTP 403 Forbidden with the message `Read access to project PROJECT_NAME was denied`, then use the following resolution.\n\n**Resolution**\n\n1. Check the IAM permissions of the requester.\n2. Check the location for the request. Unsupported regions can return a permission denied error. For more information about supported locations, see [Locations](/certificate-authority-service/docs/locations).\n\nDeleting a CA returns HTTP 412 Failed Precondition\n--------------------------------------------------\n\nIf you see the following failed precondition errors when deleting a CA, use the resolution in this section.\n\n- `Cannot perform Certificate Authority deletion, Certificate Authority is in state ENABLED.`\n\n**Resolution**\n\nA CA needs to be in `DISABLED` or `STAGED` state for it to be deleted. Ensure the state of your CA before scheduling it for deletion. For more information about CA states, see [CA states](/certificate-authority-service/docs/certificate-authority-states).\n\nCertificate issuance failure\n----------------------------\n\nCA Service provides several policy controls that you can use to manage certificate issuance. For more information about the policy controls, see [Overview of certificate templates and issuance policies](/certificate-authority-service/docs/policy-controls).\n\nCertificate issuance can fail because of several reasons. Some of these reasons are as follows.\n\n- Conflict between CA pool's certificate issuance policy and certificate template.\n\n For example, consider that the issuance policy defines an extension `foo` and assigns it the value `bar` and the certificate template defines extension `foo` and assigns it the value `bat`. Assigning two different values to the same extension creates a conflict.\n\n **Resolution**\n\n Review the CA pool's certificate issuance policy against the certificate template, and identify and resolve the conflicts.\n\n For more information about issuance policies, see [Add a certificate issuance policy to a CA pool](/certificate-authority-service/docs/use-issuance-policy).\n- Subject or Subject Alternate Names (SANs) fail the CEL expression evaluation in either the certificate template or the CA pool's certificate issuance policy.\n\n **Resolution**\n\n Review the CA pool's certificate issuance policy and certificate template, and ensure that the subject and SAN satisfy the conditions set by Common Expression Language (CEL) expressions. For more information about CEL expressions, see [Using Common Expression Language](/certificate-authority-service/docs/using-cel).\n- Incorrect IAM role being granted for a use case. For example, assigning the `roles/privateca.certificateRequester` role for reflected identity or assigning the `roles/privateca.workloadCertificateRequester` role for default identity mode.\n\n **Resolution**\n\n Confirm that you have assigned the `roles/privateca.certificateRequester` role for default identity mode and the `roles/privateca.workloadCertificateRequester` role for reflected identity. For more information about using identity reflection, see [Identity reflection for federated workloads](/certificate-authority-service/docs/using-identity-reflection).\n- Attempting to use the reflected identity mode in an unsupported scenario, such as without Hub workload identity. An unsupported scenario for identity reflection returns the following error message:\n\n ```\n Could not use the REFLECTED_SPIFFE subject mode because the caller does not have a SPIFFE identity. Please visit the CA Service documentation to ensure that this is a supported use-case.\n ```\n\n **Resolution**\n\n Determine which type of identity you need to use: default identity or reflected identity. If you need to use reflected identity, make sure that you are using it in one of the supported scenarios. For more information about identity reflection, see [Identity reflection for federated workloads](/certificate-authority-service/docs/using-identity-reflection).\n- The default key size restriction rejects RSA keys with modulus size less than\n 2048 bits.\n\n Industry best practices recommend using an RSA key of at least 2048 bits.\n By default, CA Service prevents issuing certificates using an\n RSA key whose modulus size is less than 2048 bits.\n\n **Resolution**\n\n If you want to use a RSA key with modulus size less than 2048 bits, you must\n explicitly allow it [using the certificate issuance policy](/certificate-authority-service/docs/use-issuance-policy#gcloud).\n Use the following YAML example to allow such RSA keys: \n\n allowedKeyTypes:\n - rsa:\n minModulusSize: 1024\n\nWhat's next\n-----------\n\n- Learn about the [best practices for using Certificate Authority Service](/certificate-authority-service/docs/best-practices).\n- [Frequently asked questions](/certificate-authority-service/docs/faqs)"]]