上传后 UI 中未显示 CloudFront SSL 证书

CloudFront SSL Certificate Not Showing up in UI After Uploading

我一直在使用 Cloudfront 来终止几个网站的 SSL,但由于某种原因我似乎无法让它识别我新上传的 SSL 证书。

这是我到目前为止所做的:

已购买有效的 SSL 证书,并通过 AWS cli 工具上传如下:

$ aws iam upload-server-certificate \
  --server-certificate-name www.codehappy.io \
  --certificate-body file://www.codehappy.io.crt  \
  --private-key file://www.codehappy.io.key \
  --certificate-chain file://www.codehappy.io.chain.crt \
  --path /cloudfrount/codehappy-www/

为此我得到以下输出:

{
    "ServerCertificateMetadata": {
        "ServerCertificateId": "ASCAIKR2OSE6GX43URB3E",
        "ServerCertificateName": "www.codehappy.io",
        "Expiration": "2016-10-19T23:59:59Z",
        "Path": "/cloudfrount/codehappy-www/",
        "Arn": "arn:aws:iam::001177337028:server-certificate/cloudfrount/codehappy-www/www.codehappy.io",
        "UploadDate": "2015-10-20T20:02:36.983Z"
    }
}

注意:我首先 运行 aws configure 并提供了我的 IAM 用户的凭证(这工作得很好)。

接下来,我 运行 使用以下命令查看 IAM 上所有现有 SSL 证书的列表:

$ aws iam list-server-certificates
{
    "ServerCertificateMetadataList": [
        {
            "ServerCertificateId": "ASCAIIMOAKWFL63EKHK4I",
            "ServerCertificateName": "www.ipify.org",
            "Expiration": "2016-05-25T23:59:59Z",
            "Path": "/cloudfront/ipify-www/",
            "Arn": "arn:aws:iam::001177337028:server-certificate/cloudfront/ipify-www/www.ipify.org",
            "UploadDate": "2015-05-26T04:30:15Z"
        },
        {
            "ServerCertificateId": "ASCAJB4VOWIYAWN5UEQAM",
            "ServerCertificateName": "www.rdegges.com",
            "Expiration": "2016-05-28T23:59:59Z",
            "Path": "/cloudfront/rdegges-www/",
            "Arn": "arn:aws:iam::001177337028:server-certificate/cloudfront/rdegges-www/www.rdegges.com",
            "UploadDate": "2015-05-29T00:11:23Z"
        },
        {
            "ServerCertificateId": "ASCAJCH7BQZU5SZZ52YEG",
            "ServerCertificateName": "www.codehappy.io",
            "Expiration": "2016-10-19T23:59:59Z",
            "Path": "/cloudfrount/codehappy-www/",
            "Arn": "arn:aws:iam::001177337028:server-certificate/cloudfrount/codehappy-www/www.codehappy.io",
            "UploadDate": "2015-10-20T20:09:22Z"
        }
    ]
}

注意:如您所见,我可以查看所有三个 SSL 证书,包括我新创建的证书。

接下来,我登录 IAM UI 以验证我的 IAM 用户帐户是否具有管理员访问权限:

如您所见,我的用户属于 'Admins' 组,该组对 AWS 具有无限制的管理员访问权限。

最后,我登录 Cloudfront UI 并尝试 select 我的新 SSL 证书。不幸的是,这似乎是行不通的地方 =/ 只列出了我的另外两个 SSL 证书:

有人知道我需要做什么才能将我的新 SSL 证书用于 Cloudfront 吗?

非常感谢!

最有可能的问题是路径不正确。不是 cloudfrount 而是 cloudfront

我有一个非常相似的问题,这个问题与我的私钥加密直接相关。重新颁发证书使用 RSA 2048 位而不是 RSA 4096 位 CSR 加密解决了我的问题。也可能是加密之外的其他东西,例如你的块的格式或使用加密的私钥。

简而言之,ACM 的导入过滤器不会捕获所有内容,也不会验证所有 AWS 产品的工作有效性,因此在使用外部证书时,请仔细检查您的加密级别设置是否与 CloudFront 兼容。以下是 CloudFront 的兼容性问题列表。请记住,兼容性因产品而异,因此请务必仔细检查。 https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/cnames-and-https-requirements.html

如果我像往常一样先阅读,我就不会头疼了。 4096 位非常适合某些 ACM 功能,但这不包括 CloudFront。

Importing a certificate into AWS Certificate Manager (ACM): public key length must be 1024 or 2048 bits. The limit for a certificate that you use with CloudFront is 2048 bits, even though ACM supports larger keys.