All Products
Search
Document Center

Server Load Balancer:UploadServerCertificate

Last Updated:Sep 20, 2024

Uploads a server certificate.

Operation description

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

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
slb:UploadServerCertificatecreate
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
Tagarray<object>No

The tags.

objectNo

The tags.

KeystringNo

The key of tag N. Valid values of N: 1 to 20. The tag key cannot be an empty string.

The tag key can be up to 64 characters in length, and cannot contain http:// or https://. The tag key cannot start with aliyun or acs:.

TestKey
ValuestringNo

The value of tag N. Valid values of N: 1 to 20. The tag value can be an empty string. The tag value can be up to 128 characters in length and cannot contain http:// or https://. The tag value cannot start with aliyun and acs:.

TestValue
RegionIdstringYes

The region ID of the CLB instance.

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

cn-hangzhou
AliCloudCertificateIdstringNo

AliCloud certificate ID.

775****
AliCloudCertificateNamestringNo

AliCloud certificate name.

cloudcertificate
AliCloudCertificateRegionIdstringNo

The region ID of AliCloud certificate.

cn-hangzhou
ServerCertificatestringNo

The server certificate to be uploaded.

-----BEGIN CERTIFICATE----- MIIGDTCC****** -----END CERTIFICATE-----
PrivateKeystringNo

The private key of the certificate.

-----BEGIN RSA PRIVATE KEY----- MIIEogIB****** -----END RSA PRIVATE KEY-----
ServerCertificateNamestringNo

The name of the server certificate.

The name must be 1 to 80 characters in length. It must start with an English letter. It can contain letters, numbers, periods (.), underscores (_), and hyphens (-).

mycert01
ResourceGroupIdstringNo

The resource group ID.

rg-atstuj3rto****

Response parameters

ParameterTypeDescriptionExample
object
AliCloudCertificateNamestring

The AliCloud certificate name.

cloudcertificate****
CreateTimeStamplong

The timestamp generated when the CA certificate is uploaded.

1504147745000
ExpireTimestring

The time when the CA certificate expires.

2022-10-18T23:59:59Z
CreateTimestring

The time when the CA certificate is uploaded.

2022-02-21T02:49:05Z
ServerCertificateIdstring

The ID of the server certificate.

1321932713******_17f1b4b696b_1114720822_-1671******
ExpireTimeStamplong

The timestamp generated when the CA certificate expires.

1504147745000
RegionIdstring

The ID of the region where the Classic Load Balancer (CLB) instance is deployed.

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

cn-hangzhou
RequestIdstring

The ID of the request.

365F4154-92F6-4AE4-92F8-7FF34B540710
Fingerprintstring

The fingerprint of the CA certificate.

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

The name of the server certificate.

The name must be 1 to 80 characters in length. It must start with an English letter. It can contain letters, numbers, periods (.), underscores (_), and hyphens (-).

mycert01
CommonNamestring

The domain name of the CA certificate.

example.com
ResourceGroupIdstring

The resource group ID.

rg-atstuj3rt****
AliCloudCertificateIdstring

The AliCloud certificate ID.

775****
IsAliCloudCertificateinteger

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

  • 0: The certificate is not provided by Alibaba Cloud Certificate Management Service.
  • 1: The certificate is provided by Alibaba Cloud Certificate Management Service.
0
SubjectAlternativeNamesarray

The subject alternative names.

A domain name list is supported. A maximum of 10 domain names are supported.

string

The subject alternative names.

A domain name list is supported. A maximum of 10 domain names are supported.

["example.com","www.example.com"]

Examples

Sample success responses

JSONformat

{
  "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\"]"
    ]
  }
}

Error codes

HTTP status codeError codeError messageDescription
400IllegalParam.ServerCertificateThe specified server certificate is illegal.-
400InvalidParameterThe specified ServerCertificate and PrivateKey fail to validate.-
400ServerCertificate.NotSupportThe specified Region Not support ServerCertificate.-
400InvalidParameter.AliCloudCertificateIdThe specified AliCloudCertificateId is invalid.-
400OperationDenied.IllegalKeyLengthThe operation is not allowed because the key length of certificate is illegal.-
400InvalidParam.TagValue %s.-
400InvalidParam.TagKey%s.-
400SizeLimitExceeded.Tag%s.-
400MissingParam.TagKeyThe param MissingParam.TagKey is missing.-
400EccCertificateNotSupportThe ECC certificate is not support.ECC certificate not supported
400CertificateFormatInvalidThe certificate format is invalid.The certificate is not in the correct format.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-09-26The Error code has changedView Change Details
2023-06-02The Error code has changedView Change Details

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