全部产品
Search
文档中心

边缘安全加速:SetCertificate - 配置站点证书

更新时间:Jan 26, 2026

用于设置某站点下是否启用证书功能及更新证书信息。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。

  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。

  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:

    • 对于必选的资源类型,用前面加 * 表示。

    • 对于不支持资源级授权的操作,用全部资源表示。

  • 条件关键字:是指云产品自身定义的条件关键字。

  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。

操作

访问级别

资源类型

条件关键字

关联操作

esa:SetCertificate

none

*全部资源

*

请求参数

名称

类型

必填

描述

示例值

SiteId

integer

站点 ID。可通过 ListSites 接口获取。

1234567890123

Name

string

证书名称,type 为 upload 类型时需要输入该参数。

yourCertName

CasId

integer

云证书 Id,type 为 cas 的情况下需要输入该参数。

30000478

Type

string

证书类型。

  • cas:证书中心证书

  • upload:自定义上传证书

  • keyless:keyless 证书

cas

Certificate

string

证书内容,type 为 upload 类型时需要输入该参数。

-----BEGIN CERTIFICATE-----

PrivateKey

string

证书私钥,type 为 upload 类型时需要输入该参数。

-----BEGIN PRIVATE KEY-----

Region

string

地域,type 为 cas 的情况下需要输入该参数。

  • 中国站账号传参数值:cn-hangzhou

  • 国际站账号传参数值:ap-southeast-1

cn-hangzhou

Id

string

证书 Id,不支持 free 类型(通过接口 ApplyCertificate 创建)的证书 Id,可以支持 cas 和 upload 类型的证书 Id。

babae7c40fef412d887688b91c9e****

KeyServerId

string

Keyless server ID,当 Type 为 keyless 时有效。

1233112****

返回参数

名称

类型

描述

示例值

object

Schema of Response

RequestId

string

请求 ID。

A666D44F-19D6-490E-97CF-1A64AB962C57

Id

string

证书 Id

babae7c40fef412d887688b91c9e****

示例

正常返回示例

JSON格式

{
  "RequestId": "A666D44F-19D6-490E-97CF-1A64AB962C57",
  "Id": "babae7c40fef412d887688b91c9e****"
}

错误码

HTTP status code

错误码

错误信息

描述

400 Certificate.StatusError The status of the certificate is invalid. 证书状态错误。
400 Certificate.Duplicated The certificate name already exists. 证书重复。
400 InvalidParameter The specified parameter is invalid. 输入参数规范校验失败。
400 InvalidCertificate.NotFound The specified certificate does not match the website. Check the validity of the certificate and try again. 您提供的证书与该站点不匹配,请确认证书的有效性并重新发起请求。
400 InvalidSSLPub The specified Certificate is invalid. Certificate错误,请重新填写。
400 InvalidSSLPri The specified PrivateKey is invalid. PrivateKey错误,请填写正确的PrivateKey。
400 CasId.MissingParameter The CasId parameter is required. CasId参数缺失。
400 PrivateKey.MissingParameter The PrivateKey parameter is required. PrivateKey参数缺失。
400 Certificate.MissingParameter The Certificate parameter is required. Certificate参数缺失。
400 InvalidParameter.SiteId Failed to query the website based on the SiteID you specified. Check parameter SiteId and try again. SiteId参数无效,无法通过指定的SiteId获取对应的站点名称,请确认SiteId后重试。
400 InternalException Failed to call the service. Try again later or contact technical support. 调用服务失败,请稍后重试或联系客服咨询详情。
400 UpdateFreeCertificate.NotSupport The free certificate does not support the update operation. 免费证书不支持更新操作。
400 CertificateDomainNotMatchSite The domain name in the specified certificate does not match the site. 证书中的域名和当前站点不匹配。
400 CertificateNotMatchPrivateKey The specified certificate does not match the private key. 指定的证书和私钥不匹配。
400 CertQuotaCheckFailed The custom certificate quota verification failed. The number of uploaded certificates exceeds the upper limit allowed for the plan. 自定义证书配额校验失败,上传证书数量超过套餐允许上限。
404 Certificate.NotFound The specified certificate does not exist. 指定的证书不存在。

访问错误中心查看更多错误码。

变更历史

更多信息,参考变更详情