跳至內容

如何使用 ACM,對 CloudFront 發佈項目「InvalidViewerCertificte」網域名稱錯誤進行疑難排解?

2 分的閱讀內容
0

我想使用 AWS Certificate Manager (ACM),對在建立或更新 Amazon CloudFront 發佈項目時,收到的「InvalidViewerCertificate」錯誤進行疑難排解。

解決方法

確定您的憑證符合所有要求

您收到以下錯誤訊息:

「The specified SSL certificate doesn't exist, isn't in us-east-1 region, isn't valid, or doesn't include a valid certificate chain.」

若要解決此問題,請執行下列動作:

此外,對憑證使用以下組態:

  • 在美國東部 (維吉尼亞北部) 區域匯入憑證。
  • 使用 4096 位元或更小的憑證金鑰。
  • 不要保護密碼。
  • 使用 PEM 編碼憑證。

使用包含 CNAME 的憑證

您收到以下錯誤訊息:

「To add an alternate domain name (CNAME) to a CloudFront distribution, you must attach a trusted certificate that validates your authorization to use the domain name.」

當憑證的主體替代名稱 (SAN) 不包含您在 CloudFront 發佈項目中指定的 CNAME 時,會發生此錯誤。

若要解決此問題,請申請公用憑證。您也可以聯絡憑證認證機構 (CA),取得包含發佈項目 CNAME 的更新憑證。

使用五個或更少憑證

您收到以下錯誤訊息:

「The certificate that is attached to your distribution has too many certificates in the certificate chain.」

當憑證鏈中的憑證數量超過五個上限時,就會發生此錯誤。若要解決此問題,請使用包含五個或更少憑證的新憑證鏈。

如果您目前的 CA 不支援五個或更少憑證,請申請公用憑證

取得更新的憑證鏈

您收到下列其中一個錯誤訊息:

「The certificate that is attached to your distribution has one or more expired certificates in the certificate chain.Make sure that each certificate in the chain is valid for the current date by reviewing the Not Valid After field.」

-或-

「The certificate that is attached to your distribution has one or more certificates in the certificate chain that aren't valid yet.Make sure that each certificate in the chain is valid for the current date by reviewing the Not Valid Before field.」

如果您的憑證已過期,則必須從您的 CA 取得更新的憑證鏈。

請完成下列步驟:

  1. 從您的 CA 下載正確的鏈檔案。
  2. 將憑證與鏈重新匯入 ACMAWS Identity and Access Management (IAM)
  3. 重新嘗試建立或更新您的 CloudFront 發佈項目請求。

如果您的憑證尚未生效,則無法將其匯入。檢查憑證的「尚未生效」欄位,然後重新嘗試請求。

如果無法重新嘗試請求,請申請公用憑證

使用可信的 CA

您收到以下錯誤訊息:

「The certificate that is attached to your distribution was not issued by a trusted Certificate Authority.」

若要解決此問題,請從可信的 CA 取得 CloudFront 憑證,以使用 CNAME 記錄。如果您目前的 CA 不支援此情境,請申請公用憑證

**注意:**您可以使用自我簽署憑證僅驗證現有的 CNAME 記錄,而不是新的 CNAME 記錄。

檢查 SAN 欄位的格式

您收到以下錯誤訊息:

「The certificate that is attached to your distribution has a value in the SAN field that is not correctly formatted.」

CloudFront 要求每個項目必須是包含完整網域名稱 (FQDN) 的 DNS 名稱或 IP 位址。萬用字元的項目有效,但您無法新增高於或低於萬用字元層級的 CNAME

如果您目前的 CA 不支援此情境,請申請公用憑證

將 CNAME 新增至 API 呼叫

您收到以下錯誤訊息:

「The certificate that you specified doesn't cover the alternate domain name (CNAME) that you're trying to add.」

當您嘗試關聯至發佈項目的 CNAME 未包含在憑證的 SAN 中時,就會發生此錯誤。若要解決此問題,您必須在 CreateDistributionUpdateDistribution API 呼叫中提供該 CNAME。

重新嘗試 API 呼叫

您收到以下錯誤訊息:

「CloudFront encountered an internal error.Please try again.」

如果您在執行 CreateDistributionUpdateDistribution API 呼叫時收到上述錯誤訊息,請重新嘗試這些呼叫。 如果問題持續一段較長時間,請檢查 AWS Health Dashboard 是否有相關問題。

相關資訊

為什麼我無法為 CloudFront 發佈項目選擇自訂 SSL/TLS 憑證?

AWS 官方已更新 6 個月前