[GH-ISSUE #715] [Feature] 支持Fastly CDN部署 #482

Open
opened 2026-03-03 01:03:41 +03:00 by kerem · 4 comments
Owner

Originally created by @willow-god on GitHub (May 21, 2025).
Original GitHub issue: https://github.com/certimate-go/certimate/issues/715

功能描述 / Description

希望可以支持部署Fastly CDN,部署到证书夹中:

Image

请求动机 / Motivation

Fastly CDN是和CloudFlare一样的国外cdn,但是每个月有500GB流量,支持cname接入,优化后国内速度比Cloudflare更快,但是证书仅仅支持2个免费续签证书,后面就需要付费或者自己上传了,希望可以支持Fastly CDN证书的部署。

其他 / Miscellaneous

首先,我不清楚开发者您是否用过Fastly CDN,所以我找了一篇写的比较全面的使用教程供您参考:
https://blog.ihwx.cn/archives/1745499509105

对于API部分,有官网API如下:https://www.fastly.com/documentation/reference/api/tls/platform/

几乎所有的api都在如下地址中提供:https://www.fastly.com/documentation/reference/api/

为了让您能更加方便的查看,我还找到了一个接口文档:https://www.postman.com/fastly/fastly-developer-hub/request/uqqucdq/update-a-certificate

希望能够帮助到作者适配,感谢作者的贡献,很喜欢您的项目!

贡献 / Contribution

  • 我乐意为此贡献代码! / I am interested in contributing to this issue!
Originally created by @willow-god on GitHub (May 21, 2025). Original GitHub issue: https://github.com/certimate-go/certimate/issues/715 ### 功能描述 / Description 希望可以支持部署Fastly CDN,部署到证书夹中: ![Image](https://github.com/user-attachments/assets/70817d27-a16e-40ca-a91b-dcfb7d014fe5) ### 请求动机 / Motivation Fastly CDN是和CloudFlare一样的国外cdn,但是每个月有500GB流量,支持cname接入,优化后国内速度比Cloudflare更快,但是证书仅仅支持2个免费续签证书,后面就需要付费或者自己上传了,希望可以支持Fastly CDN证书的部署。 ### 其他 / Miscellaneous 首先,我不清楚开发者您是否用过Fastly CDN,所以我找了一篇写的比较全面的使用教程供您参考: https://blog.ihwx.cn/archives/1745499509105 对于API部分,有官网API如下:https://www.fastly.com/documentation/reference/api/tls/platform/ 几乎所有的api都在如下地址中提供:https://www.fastly.com/documentation/reference/api/ 为了让您能更加方便的查看,我还找到了一个接口文档:https://www.postman.com/fastly/fastly-developer-hub/request/uqqucdq/update-a-certificate 希望能够帮助到作者适配,感谢作者的贡献,很喜欢您的项目! ### 贡献 / Contribution - [ ] 我乐意为此贡献代码! / I am interested in contributing to this issue!
Author
Owner

@fudiwei commented on GitHub (May 21, 2025):

已经给 Fastly 预留提供商类型很久了,迟迟没动手的原因是它的接口文档我没看明白…… 😂

为了让您能更加方便的查看,我还找到了一个接口文档:https://www.postman.com/fastly/fastly-developer-hub/request/uqqucdq/update-a-certificate

正常来说一个 SSL 证书是包含证书和私钥两部分的,但你贴的这个接口里,它只上传证书,私钥去哪儿了?

<!-- gh-comment-id:2897909348 --> @fudiwei commented on GitHub (May 21, 2025): 已经给 Fastly 预留提供商类型很久了,迟迟没动手的原因是它的接口文档我没看明白…… 😂 > 为了让您能更加方便的查看,我还找到了一个接口文档:https://www.postman.com/fastly/fastly-developer-hub/request/uqqucdq/update-a-certificate 正常来说一个 SSL 证书是包含证书和私钥两部分的,但你贴的这个接口里,它只上传证书,私钥去哪儿了?
Author
Owner

@willow-god commented on GitHub (May 21, 2025):

您好开发者,感谢您的回复和开发,我查阅了一下资料,Fastly的密钥和证书是分开的,首先通过:
https://www.fastly.com/documentation/reference/api/tls/custom-certs/private-keys/
接口上传密钥,成功后,会得到一个密钥ID,然后再凭借这个密钥ID,上传证书,通过:
https://www.fastly.com/documentation/reference/api/tls/custom-certs/certificates/
接口,如果一切正常,则会获得一个certificate_id,然后再凭借这个ID,再找到一个证书和域名的绑定(fastly似乎是将绑定单独了一个页面),部署到某个域名中,完成所有的过程。

Image

控制台上传证书也是这个流程

<!-- gh-comment-id:2898041481 --> @willow-god commented on GitHub (May 21, 2025): 您好开发者,感谢您的回复和开发,我查阅了一下资料,Fastly的密钥和证书是分开的,首先通过: https://www.fastly.com/documentation/reference/api/tls/custom-certs/private-keys/ 接口上传密钥,成功后,会得到一个密钥ID,然后再凭借这个密钥ID,上传证书,通过: https://www.fastly.com/documentation/reference/api/tls/custom-certs/certificates/ 接口,如果一切正常,则会获得一个`certificate_id`,然后再凭借这个ID,再找到一个证书和域名的绑定(fastly似乎是将绑定单独了一个页面),部署到某个域名中,完成所有的过程。 ![Image](https://github.com/user-attachments/assets/7be1a141-3855-40a7-b9fa-e9453d87c566) 控制台上传证书也是这个流程
Author
Owner

@fudiwei commented on GitHub (May 22, 2025):

您好开发者,感谢您的回复和开发,我查阅了一下资料,Fastly的密钥和证书是分开的,首先通过: https://www.fastly.com/documentation/reference/api/tls/custom-certs/private-keys/ 接口上传密钥,成功后,会得到一个密钥ID,然后再凭借这个密钥ID,上传证书,通过: https://www.fastly.com/documentation/reference/api/tls/custom-certs/certificates/ 接口,如果一切正常,则会获得一个certificate_id,然后再凭借这个ID,再找到一个证书和域名的绑定(fastly似乎是将绑定单独了一个页面),部署到某个域名中,完成所有的过程。

可上传证书的接口里并不需要传密钥 ID 😂 我就很好奇它俩咋关联在一起的?难道是 Fastly 分别从证书和私钥里提取出公钥,自动完成关联的?

<!-- gh-comment-id:2899796020 --> @fudiwei commented on GitHub (May 22, 2025): > 您好开发者,感谢您的回复和开发,我查阅了一下资料,Fastly的密钥和证书是分开的,首先通过: https://www.fastly.com/documentation/reference/api/tls/custom-certs/private-keys/ 接口上传密钥,成功后,会得到一个密钥ID,然后再凭借这个密钥ID,上传证书,通过: https://www.fastly.com/documentation/reference/api/tls/custom-certs/certificates/ 接口,如果一切正常,则会获得一个`certificate_id`,然后再凭借这个ID,再找到一个证书和域名的绑定(fastly似乎是将绑定单独了一个页面),部署到某个域名中,完成所有的过程。 可上传证书的接口里并不需要传密钥 ID 😂 我就很好奇它俩咋关联在一起的?难道是 Fastly 分别从证书和私钥里提取出公钥,自动完成关联的?
Author
Owner

@willow-god commented on GitHub (May 22, 2025):

我这边本来尝试写个python脚本测试一下,但是他提示说需要绑定银行卡才能够使用证书这部分的api

{
  "errors": [
    {
      "title": "Can't create resource",
      "detail": "In order to perform this action, your account needs to be upgraded. Please add a credit 
card or reach out to support@fastly.com"
    }
  ]
}

所以不太清楚了,我搜索chatgpt他是说在请求中添加一个realtionships,如下:

"data": {
            "type": "tls_certificate",
            "attributes": {
                "cert_blob": cert_pem,
                "name": "My Certificate"
            },
            "relationships": {
                "tls_private_key": {
                    "data": {
                        "type": "tls_private_key",
                        "id": private_key_id
                    }
                }
            }
        }

如果您开通了的话可以试试,我这边没有海外信用卡可能没法开呜,无论如何还是感谢开发者啦!

<!-- gh-comment-id:2900204382 --> @willow-god commented on GitHub (May 22, 2025): 我这边本来尝试写个python脚本测试一下,但是他提示说需要绑定银行卡才能够使用证书这部分的api ```txt { "errors": [ { "title": "Can't create resource", "detail": "In order to perform this action, your account needs to be upgraded. Please add a credit card or reach out to support@fastly.com" } ] } ``` 所以不太清楚了,我搜索chatgpt他是说在请求中添加一个realtionships,如下: ```txt "data": { "type": "tls_certificate", "attributes": { "cert_blob": cert_pem, "name": "My Certificate" }, "relationships": { "tls_private_key": { "data": { "type": "tls_private_key", "id": private_key_id } } } } ``` 如果您开通了的话可以试试,我这边没有海外信用卡可能没法开呜,无论如何还是感谢开发者啦!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/certimate#482
No description provided.