最近更新时间:2026-09-14 17:12:32
本接口用于设置CDN域名的 HTTPS 开关及服务器证书配置。开启HTTPS时,可关联已有证书,或提交证书名称、证书内容和私钥内容。
本接口请求需要包含指定目录/V3/SetServerCertificate、公共请求 Header 和接口所特有的请求参数,具体请求语句参照下文请求示例。请求头需携带 X-VERSION 、 X-ACTION。
参数名 | 必选 | 类型及范围 | 说明 |
|---|---|---|---|
ActionType | 是 | String | 操作类型,on(开启)/off(关闭) ActionType=on(开启HTTPS): 方式A 关联已有证书:传 CertificateId 方式B 提交新证书:传 CertificateName + ServerCertificate + PrivateKey ActionType=off(关闭HTTPS): 需传 CertificateId + CertificateName + ServerCertificate + PrivateKey |
DomainId | 是 | String | 域名ID |
CertificateId | 否 | String | 证书ID(已有证书时传入) |
CertificateName | 否 | String | 证书名称 |
ServerCertificate | 否 | String | 证书内容 |
PrivateKey | 否 | String | 私钥内容 |
请求示例
POST方式:
POST /
Host: cdn.api.ksyun.com
X-Amz-Date: date
Authorization: authorization string
X-Action: SetServerCertificate
X-Version: V3
Content-Type: application/json
{
"ActionType": "on",
"DomainId": "2D08M8V",
"CertificateId": "123456"
}返回说明
本接口调用成功返回 200 状态码,响应体为空(无 JSON 返回);若调用失败,参数校验失败返回 400 + Error JSON(含 Error.Code/Message);鉴权失败返回 403;具体错误原因详见【使用须知】中错误代码表说明。
纯净模式
