All Products
Search
Document Center

Server Load Balancer:UploadServerCertificate

Last Updated:Sep 08, 2026

Uploads a server certificate.

Operation description

  • You can upload only one server certificate and its corresponding private key at a time.

  • After the upload succeeds, the fingerprint information of all server certificates of the user is returned.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

slb:UploadServerCertificate

create

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

Tag

array<object>

No

The tags.

object

No

The tags.

Key

string

No

The tag key of the resource. Valid values of N: 1 to 20. The tag key cannot be an empty string if you specify this parameter.

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

TestKey

Value

string

No

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

TestValue

RegionId

string

Yes

The region ID where the server certificate is deployed.

You can call the DescribeRegions operation to query region IDs.

cn-hangzhou

AliCloudCertificateId

string

No

The ID of the certificate issued by Alibaba Cloud.

Note

This parameter is required if you use a certificate issued by Alibaba Cloud.

775****

AliCloudCertificateName

string

No

The name of the certificate issued by Alibaba Cloud.

You can call the GetUserCertificateDetail operation to query the certificate name.

Note

This parameter is required if you use a certificate issued by Alibaba Cloud.

cloudcertificate

AliCloudCertificateRegionId

string

No

The region ID of the certificate issued by Alibaba Cloud.

Note

This parameter is required if you use a certificate issued by Alibaba Cloud.

cn-hangzhou

ServerCertificate

string

No

The public key certificate to upload.

Note

This parameter is required if you upload a certificate that is not issued by Alibaba Cloud.

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

PrivateKey

string

No

The private key to upload.

Note

This parameter is required if you upload a certificate that is not issued by Alibaba Cloud.

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

ServerCertificateName

string

No

The name of the server certificate that is not issued by Alibaba Cloud. The name must be 1 to 80 characters in length and can contain Chinese characters, letters, digits, hyphens (-), forward slashes (/), periods (.), underscores (_), and asterisks (*).

Note

This parameter is required if you upload a certificate that is not issued by Alibaba Cloud.

mycert01

ResourceGroupId

string

No

The resource group ID.

rg-atstuj3rto****

Response elements

Element

Type

Description

Example

object

The response struct.

AliCloudCertificateName

string

The name of the certificate issued by Alibaba Cloud.

cloudcertificate****

CreateTimeStamp

integer

The timestamp when the certificate was created.

1504147745000

ExpireTime

string

The expiration time of the certificate.

2022-10-18T23:59:59Z

CreateTime

string

The time when the certificate was created.

2022-02-21T02:49:05Z

ServerCertificateId

string

The server certificate ID.

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

ExpireTimeStamp

integer

The timestamp when the certificate expires.

1504147745000

RegionId

string

The region ID where the server certificate is deployed.

cn-hangzhou

RequestId

string

The request ID.

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

Fingerprint

string

The fingerprint of the server certificate.

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

ServerCertificateName

string

The name of the server certificate that is not issued by Alibaba Cloud.

mycert01

CommonName

string

The domain name, which corresponds to the Common Name field of the certificate.

example.com

ResourceGroupId

string

The resource group ID.

rg-atstuj3rt****

AliCloudCertificateId

string

The ID of the certificate issued by Alibaba Cloud.

775****

IsAliCloudCertificate

integer

Indicates whether the certificate is from SSL Certificates Service. Valid values:

  • 0: The certificate is not from SSL Certificates Service.

  • 1: The certificate is from SSL Certificates Service.

0

SubjectAlternativeNames

object

SubjectAlternativeName

array

The list of alternative domain names of the certificate.

string

The list of alternative domain names of the certificate in array format, which corresponds to the Subject Alternative Name field of the certificate.

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

Examples

Success response

JSON format

{
  "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 code

Error code

Error message

Description

400 IllegalParam.ServerCertificate The specified server certificate is illegal. The specified ServerCertificate is invalid. Check the parameter constraints and try again.
400 InvalidParameter The specified ServerCertificate and PrivateKey fail to validate. The Vgw ip is empty. Specify the Vgw ip parameter.
400 ServerCertificate.NotSupport The specified Region Not support ServerCertificate. Server certificates are not supported in the specified region.
400 InvalidParameter.AliCloudCertificateId The specified AliCloudCertificateId is invalid. The specified AliCloudCertificateId is invalid. Check the parameter constraints and try again after making corrections.
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 certificate not supported
400 CertificateFormatInvalid The certificate format is invalid. The certificate is not in the correct format.
403 UnauthorizedRegion The specified region of is not authorized. The specified region of is not authorized.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.