Uploads a server certificate.

Description

  • You can upload only one server certificate and its private key in each request.
  • After a server certificate and its private key are uploaded, the fingerprints of all server certificates that belong to your account are returned.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Item Required Example Description
Action String Yes UploadServerCertificate

The operation that you want to perform. Set the value to UploadServerCertificate.

RegionId String Yes cn-hangzhou

The ID of the region where the server certificate is created.

You can call the DescribeRegions operation to query the most recent region list.

AliCloudCertificateId String No 1321932713******_17f1b4b696b_1114720822_-1671******

The ID of the server certificate that is provided by Alibaba Cloud Certificate Management Service.

Note This parameter is required if you use a server certificate from Alibaba Cloud Certificate Management Service.
AliCloudCertificateName String No cloudcertificate

The name of the server certificate that is provided by Alibaba Cloud Certificate Management Service.

Note This parameter is required if you use a server certificate from Alibaba Cloud Certificate Management Service.
AliCloudCertificateRegionId String No cn-hangzhou

The ID of the region where the server certificate from Alibaba Cloud Certificate Management Service is created.

ServerCertificate String No -----BEGIN CERTIFICATE----- MIIGDTCC****** -----END CERTIFICATE-----

The public key certificate that you want to upload.

Note This parameter is required if you use a server certificate from a third-party service provider.
PrivateKey String No -----BEGIN RSA PRIVATE KEY----- MIIEogIB****** -----END RSA PRIVATE KEY-----

The private key that you want to upload.

Note This parameter is required if you use a server certificate from a third-party service provider.
ServerCertificateName String No mycert01

The name of the server certificate that you want to upload. The name must be 1 to 80 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). It must start with a letter.

ResourceGroupId String No rg-atstuj3rto****

The ID of the resource group.

Response parameters

Parameter Item Example Description
AliCloudCertificateName String cloudcertificate****

The name of the server certificate that is provided by Alibaba Cloud Certificate Management Service.

CreateTimeStamp Long 1504147745000

The timestamp generated when the server certificate is created.

ExpireTime String 2022-10-18T23:59:59Z

The time when the server certificate expires.

CreateTime String 2022-02-21T02:49:05Z

The time when the server certificate is created.

ServerCertificateId String 1321932713******_17f1b4b696b_1114720822_-1671******

The ID of the server certificate.

ExpireTimeStamp Long 1504147745000

The timestamp generated when the server certificate expires.

RegionId String cn-hangzhou

The ID of the region where the server certificate is created.

RequestId String 365F4154-92F6-4AE4-92F8-7FF34B540710

The ID of the request.

Fingerprint String 8f:7d:cb:e5:f8:c8:33:9c:17:65:c1:92:30:9e:45:55:9c:3a:85:60

The fingerprint of the server certificate.

ServerCertificateName String mycert01

The name of the server certificate.

CommonName String example.com

The domain name in the Common Name field of the server certificate.

ResourceGroupId String rg-atstuj3rt****

The ID of the resource group.

AliCloudCertificateId String 1321932713******_17f1b4b696b_1114720822_-1671******

The ID of the server certificate that is provided by Alibaba Cloud Certificate Management Service.

IsAliCloudCertificate Integer 0

Indicates whether the server certificate is provided by Alibaba Cloud Certificate Management Service. Valid values:

  • 0: The server certificate is provided by a third-party service provider.
  • 1: The server certificate is provided by Alibaba Cloud Certificate Management Service.
SubjectAlternativeNames Array of String ["example.com","www.example.com"]

The list of alternative domain names of the server certificate. The alternative domain names are specified in the Subject Alternative Name field of the server certificate.

Examples

Sample requests

http(s)://[Endpoint]/?Action=UploadServerCertificate
&RegionId=cn-hangzhou
&AliCloudCertificateId=1321932713******_17f1b4b696b_1114720822_-1671******
&AliCloudCertificateName=cloudcertificate****
&AliCloudCertificateRegionId=cn-hangzhou
&ServerCertificate=-----BEGIN CERTIFICATE----- MIIGDTCC****** -----END CERTIFICATE-----
&PrivateKey=-----BEGIN RSA PRIVATE KEY----- MIIEogIB****** -----END RSA PRIVATE KEY-----
&ServerCertificateName=mycert01
&ResourceGroupId=rg-atstuj3rto****
&Common request parameters

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<UploadServerCertificateResponse>
    <AliCloudCertificateName>cloudcertificate****</AliCloudCertificateName>
    <CreateTimeStamp>1504147745000</CreateTimeStamp>
    <ExpireTime>2022-10-18T23:59:59Z</ExpireTime>
    <CreateTime>2022-02-21T02:49:05Z</CreateTime>
    <ServerCertificateId>1321932713******_17f1b4b696b_1114720822_-1671******</ServerCertificateId>
    <ExpireTimeStamp>1504147745000</ExpireTimeStamp>
    <RegionId>cn-hangzhou</RegionId>
    <RequestId>365F4154-92F6-4AE4-92F8-7FF34B540710</RequestId>
    <Fingerprint>8f:7d:cb:e5:f8:c8:33:9c:17:65:c1:92:30:9e:45:55:9c:3a:85:60</Fingerprint>
    <ServerCertificateName>mycert01</ServerCertificateName>
    <CommonName>example.com</CommonName>
    <ResourceGroupId>rg-atstuj3rt****</ResourceGroupId>
    <AliCloudCertificateId>1321932713******_17f1b4b696b_1114720822_-1671******</AliCloudCertificateId>
    <IsAliCloudCertificate>0</IsAliCloudCertificate>
    <SubjectAlternativeNames>["example.com","www.example.com"]</SubjectAlternativeNames>
</UploadServerCertificateResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/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" : "1321932713******_17f1b4b696b_1114720822_-1671******",
  "IsAliCloudCertificate" : 0,
  "SubjectAlternativeNames" : [ "[\"example.com\",\"www.example.com\"]" ]
}

Error codes

HttpCode Error code Error message Description
400 IllegalParam.ServerCertificate The specified server certificate is illegal. The error message returned because ServerCertificate is set to an invalid value. Specify a valid value and try again.
400 InvalidParameter The specified ServerCertificate and PrivateKey fail to validate. The error message returned because the verification of the certificate and private key fails.
400 ServerCertificate.NotSupport The specified Region Not support ServerCertificate. The error message returned because the specified region does not support server certificates.
400 InvalidParameter.AliCloudCertificateId The specified AliCloudCertificateId is invalid. The error message returned because AliCloudCertificateId is set to an invalid value. Specify a valid value and try again.

For a list of error codes, visit the API Error Center.