最近更新时间:2021-09-13 10:11:28
本接口用于为单个或多个加速域名配置服务证书。此接口支持形如:*.a.com的泛域名证书配置服务。
本接口请求需要包含指定目录/2016-09-01/cert/ConfigCertificate、公共请求header和该接口所特有的请求参数,具体请求语句参照下文请求示例。
参数名 | 必选 | 类型及范围 | 说明 |
---|---|---|---|
Enable | 是 | String | 开启、关闭设置服务证书,取值:on:开启,off:关闭,默认为off。当选择开启时,以下为必填 ;当选择关闭时,联动关闭 HTTP 2.0 和强制跳转 |
DomainIds | 是 | String | 域名ID,支持按逗号分隔输入多条Id |
CertificateId | 否 | String | 金山云生成的安全证书唯一性ID;若输入证书ID,则CertificateName、ServerCertificate、PrivateKey可不填写;若无证书ID,则CertificateName、ServerCertificate、PrivateKey为必填 |
CertificateName | 否 | String | 安全证书名称 |
ServerCertificate | 否 | String | 域名对应的安全证书内容 |
PrivateKey | 否 | String | 安全证书对应的私钥内容 |
注: CertificateId有值时,忽略CertificateName、ServerCertificate和Privatekey的值。
ErrorCode错误码 | Message 错误信息 | HTTP 状态 | 语义 |
---|---|---|---|
InvalidEnable.ValueNotSupported | The specified value of parameter Enable is not supported. | 400 | Enable的值不合法 |
ServerCertificate.MissingParameter | An input parameter ServerCertificate that is mandatory for processing the request is not supplied. | 400 | ServerCertificate参数缺失 |
PrivateKey.MissingParameter | An input parameter PrivateKey that is mandatory for processing the request is not supplied. | 400 | PrivateKey参数缺失 |
InvalidServerCertificate | The ServerCertificate you provided is malformed! | 400 | 证书内容不合法 |
InvalidPrivateKey | The Private Key you provided is malformed! | 400 | 私钥内容不合法 |
ServerCertificate.MissMatch | The Private Key does not math the specified ServerCertificate! | 400 | 证书和私钥不匹配 |
InvalidServerCertificate.TooLong | The ServerCertificate you provided is over the max length! | 400 | 证书私钥内容超过长度限制(16K) |
InvalidServerCertificateName.TooLong | The ServerCertificate name you provided is over the max length 128! | 400 | 证书名称不能超过128个字符 |
Certificate.Duplicated | The Certificate name is duplicated. | 400 | 证书名称重复 |
Certificate.CertNull | The Certificate is not null. | 400 | 证书不能为空 |
Certificate.FormatError | The Certificate format is error. | 400 | 证书格式错误 |
Certificate.KeyNull | The private key is not null. | 400 | 私钥不能为空 |
Key.Malformed | The private key format is error. | 400 | 私钥格式错误 |
ServerCertificateName.NameNull | The ServerCertificateName | 400 | 证书名称不能为空 |
请求示例
POST方式:
POST /2016-09-01/cert/ConfigCertificate
Host: cdn.api.ksyun.com
X-Amz-Date: date
Authorization:authorization string
x-action: ConfigCertificate
x-version: 2016-09-01
Content-Type: application/json
{
{
"Enable":"on",
"DomainIds":"2D08BS7",
"CertificateName":"test",
"ServerCertificate":"-----BEGIN CERTIFICATE-----\nMIIC2jCCAcKgAwIBAgIUUF4UPAJvGsvsrSmS4gjXfoyKWY8wDQYJKoZIhvcNAQEL\nBQAwGDEWMBQGA1UEAwwNZHlsYW5mZW5nLmNvbTAeFw0yMDEwMjkxMTU0MTBaFw0z\nMTA4MDIwMDAwMDBaMCExHzAdBgNVBAMMFnl1a2kuMTAzMC5rc2MtdGVzdC5jb20w\nggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDFBLkHpEGo5d8AdfMQzEls\nciXNv10gilLPFK+vDG/IItbdsttyA8J+s+HJtkZJatrzYFm2UPv/t6RB+gtCXi/c\nPOwRlb8H4J3t+a4ARJZZ2M8HxsRpwBllOvPrmwHMBnsq0iQVU7Mud2J1DSQJjDZt\nCrkpv0PtYg6tt704n/\nl7jc1Sac0RV8/n4Yia15cMlnxwIl1zTtIhL13cCXjWDAz1\n+lCL+puwhq6s42sLTF7g9wLFm9H9h7Wa+JLSKa63iPgW7ziDTudn1yX9fjyZScAi\nt+VzADo7FKGZl6WkfREKLYT9Dks1TLVEdF2sTxfvmq2h5H6A4FgfpW8aCJ3/WfdF\nAgMBAAGjEzARMA8GA1UdEwEB/\nwQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAKrn\nsqWg6N2KC3d6C2VE5/pJAwzQTmUla8Jq+aMwnTkS38y8PN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