上传服务器证书。
接口说明
-
一次只能上传一份服务器证书和对应的私钥。
-
上传成功后,返回该用户的所有服务器证书列表的指纹信息。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
slb:UploadServerCertificate |
create |
*全部资源
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| Tag |
array<object> |
否 |
标签列表。 |
|
|
object |
否 |
标签列表。 |
||
| Key |
string |
否 |
资源的标签键。N 的取值范围:1~20。一旦输入该值,则不允许为空字符串。 最多支持 64 个字符,不能以 |
TestKey |
| Value |
string |
否 |
资源的标签值。N 的取值范围:1~20。一旦输入该值,可以为空字符串。
最多支持 128 个字符,不能以 |
TestValue |
| RegionId |
string |
是 |
服务器证书部署的地域 ID。 您可以通过调用 DescribeRegions 接口查询地域 ID。 |
cn-hangzhou |
| AliCloudCertificateId |
string |
否 |
阿里云签发证书 ID。 说明
如果使用阿里云签发证书,该参数必选。 |
775**** |
| AliCloudCertificateName |
string |
否 |
阿里云签发证书名称。 您可以通过调用GetUserCertificateDetail - 获取证书详情接口查询证书名称。 说明
如果使用阿里云签发证书,该参数必选。 |
cloudcertificate |
| AliCloudCertificateRegionId |
string |
否 |
阿里云签发证书所属的地域 ID。 说明
如果使用阿里云签发证书,该参数必选。 |
cn-hangzhou |
| ServerCertificate |
string |
否 |
需要上传的公钥证书。 说明
如果上传非阿里云签发证书,该参数必选。 |
-----BEGIN CERTIFICATE----- MIIGDTCC****** -----END CERTIFICATE----- |
| PrivateKey |
string |
否 |
需要上传的私钥。 说明
如果上传非阿里云签发证书,该参数必选。 |
-----BEGIN RSA PRIVATE KEY----- MIIEogIB****** -----END RSA PRIVATE KEY----- |
| ServerCertificateName |
string |
否 |
要上传的非阿里云签发的服务器证书的名称。长度限制为 1~80 个字符,允许包含中文、字母、数字、短划线(-)、正斜线(/)、半角句号(.)、下划线(_)和星号(*)。 说明
如果上传非阿里云签发证书,该参数必选。 |
mycert01 |
| ResourceGroupId |
string |
否 |
资源组 ID。 |
rg-atstuj3rto**** |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
返回数据结构体。 |
||
| AliCloudCertificateName |
string |
阿里云签发证书名称。 |
cloudcertificate**** |
| CreateTimeStamp |
integer |
证书创建的时间戳。 |
1504147745000 |
| ExpireTime |
string |
证书过期时间。 |
2022-10-18T23:59:59Z |
| CreateTime |
string |
证书创建时间。 |
2022-02-21T02:49:05Z |
| ServerCertificateId |
string |
服务器证书 ID。 |
1321932713******_17f1b4b696b_1114720822_-1671****** |
| ExpireTimeStamp |
integer |
证书过期的时间戳。 |
1504147745000 |
| RegionId |
string |
服务器证书部署的地域 ID。 |
cn-hangzhou |
| RequestId |
string |
请求 ID。 |
365F4154-92F6-4AE4-92F8-7FF34B540710 |
| Fingerprint |
string |
服务器证书的指纹。 |
8f:7d:cb:e5:f8:c8:33:9c:17:65:c1:92:30:9e:45:55:9c:3a:85:60 |
| ServerCertificateName |
string |
非阿里云签发的服务器证书的名称。 |
mycert01 |
| CommonName |
string |
域名,对应证书的 |
example.com |
| ResourceGroupId |
string |
资源组 ID。 |
rg-atstuj3rt**** |
| AliCloudCertificateId |
string |
阿里云签发证书 ID。 |
775**** |
| IsAliCloudCertificate |
integer |
是否为阿里云证书服务中的证书。
|
0 |
| SubjectAlternativeNames |
object |
||
| SubjectAlternativeName |
array |
返回证书的备用域名列表。 |
|
|
string |
数组格式,返回证书的备用域名列表,对应证书的 |
["example.com","www.example.com"] |
示例
正常返回示例
JSON格式
{
"AliCloudCertificateName": "cloudcertificate****",
"CreateTimeStamp": 1504147745000,
"ExpireTime": "2022-10-18T23:59:59Z",
"CreateTime": "2022-02-21T02:49:05Z",
"ServerCertificateId": "1321932713******_17f1b4b696b_1114720822_-1671******",
"ExpireTimeStamp": 1504147745000,
"RegionId": "cn-hangzhou",
"RequestId": "365F4154-92F6-4AE4-92F8-7FF34B540710",
"Fingerprint": "8f:7d:cb:e5:f8:c8:33:9c:17:65:c1:92:30:9e:45:55:9c:3a:85:60",
"ServerCertificateName": "mycert01",
"CommonName": "example.com",
"ResourceGroupId": "rg-atstuj3rt****",
"AliCloudCertificateId": "775****",
"IsAliCloudCertificate": 0,
"SubjectAlternativeNames": {
"SubjectAlternativeName": [
"[\"example.com\",\"www.example.com\"]"
]
}
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | IllegalParam.ServerCertificate | The specified server certificate is illegal. | 指定的ServerCertificate无效。请检查参数约束,并在修改后重试。 |
| 400 | InvalidParameter | The specified ServerCertificate and PrivateKey fail to validate. | 指定的证书和私钥校验失败。 |
| 400 | ServerCertificate.NotSupport | The specified Region Not support ServerCertificate. | 指定地域不支持服务器证书。 |
| 400 | InvalidParameter.AliCloudCertificateId | The specified AliCloudCertificateId is invalid. | 指定的AliCloudCertificateId无效。请检查参数约束,并在修改后重试。 |
| 400 | OperationDenied.IllegalKeyLength | The operation is not allowed because the key length of certificate is illegal. | |
| 400 | InvalidParam.TagValue | %s. | |
| 400 | InvalidParam.TagKey | %s. | |
| 400 | SizeLimitExceeded.Tag | %s. | |
| 400 | MissingParam.TagKey | The param MissingParam.TagKey is missing. | |
| 400 | EccCertificateNotSupport | The ECC certificate is not support. | ECC证书不支持 |
| 400 | CertificateFormatInvalid | The certificate format is invalid. | 证书格式不正确。 |
| 403 | UnauthorizedRegion | The specified region of is not authorized. | 指定地域不可见。 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。