All Products
Search
Document Center

Dynamic Content Delivery Network:SetDcdnDomainSSLCertificate

Last Updated:Mar 01, 2024

Enables or disables the SSL certificate for a domain name and updates certificate details.

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
dcdn:SetDcdnDomainSSLCertificateWrite
  • Domain
    acs:dcdn:*:{#accountId}:domain/{#domainName}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
DomainNamestringYes

The domain name that is secured by the SSL certificate.

example.com
CertNamestringNo

The name of the SSL certificate. You can specify only one certificate name.

yourCertName
CertIdlongNo

The ID of the certificate. This parameter takes effect only when CertType is set to cas.

8089870
CertTypestringNo

The type of the certificate. Valid values:

  • upload: a user-uploaded SSL certificate.
  • cas: a certificate that is acquired through Certificate Management Service.
upload
SSLProtocolstringYes

Specifies whether to enable the SSL certificate. Valid values:

  • on
  • off
off
SSLPubstringNo

The content of the SSL certificate. Specify the content of the SSL certificate only if you want to enable the SSL certificate.

xxx
SSLPristringNo

The private key. Specify the private key only if you want to enable the SSL certificate.

y****
CertRegionstringNo

The region of the SSL certificate. This parameter takes effect only when CertType is set to cas. Default value: cn-hangzhou. Valid values: cn-hangzhou and ap-southeast-1.

cn-hangzhou
EnvstringNo

Specifies whether the certificate is issued in canary releases. If you set this parameter to staging, the certificate is issued in canary releases. If you do not specify this parameter or set this parameter to other values, the certificate is officially issued.

staging

Sample request:


http://dcdn.aliyuncs.com?Action=SetDcdnDomainSSLCertificate&DomainName=example.com&SSLProtocol=on&SSLPub=xxx&SSLPri=yyy&<Common request parameters>

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

A7C69682-7F88-40DD-A198-10D0309E439D

Examples

Sample success responses

JSONformat

{
  "RequestId": "A7C69682-7F88-40DD-A198-10D0309E439D"
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidSSLProtocol.ValueNotSupportedThe specified SSLProtocol is invalid.The specified SSL certificate parameter is invalid. Set the value to on or off.
400SSLPub.MissingParameterThe SSLPub parameter is required.The SSLPub parameter is not specified.
400SSLPri.MissingParameterThe SSLPri parameter is required.The SSLPri parameter is not specified.
400InvalidSSLPubThe specified SSLPub is invalid.The value specified for the SSLPub parameter is invalid.
400InvalidSSLPriThe specified SSLPri is invalid.The value specified for the SSLPri parameter is invalid.
400Certificate.MissMatchThe SSLPri does not match the certificate.The certificate and private key do not match.
400InvalidCertificate.TooLongThe maximum length of the certificate is exceeded.The maximum length of the specified certificate content has been reached.
400InvalidCertName.TooLongThe length of the certificate name cannot exceed 128 characters.The certificate name cannot contain more than 128 characters.
400IllegalOperationDomainYou are not authorized to operate the domain.You are not authorized to manage the domain name.
400AuthenticationFailedError performing verification.Identity authentication failed.
400SetDomainCertificate.ParameterErrorThe specified parameters are invalid.The specified parameter values are invalid.
400Certificate.StatusErrorThe status of the certificate is invalid.The specified certificate status is invalid.
400DeleteFailedError deleting the certificate.Failed to delete the certificate.
400Certificate.NotFindThe certificate does not exist.The specified certificate does not exist.
400Certificate.DuplicatedThe certificate name already exists.The certificate is duplicated.
400Certificate.FormatErrorThe format of the certificate is invalid.The specified certificate format is invalid.
400Certificate.StatusErrorThe certificate does not exist, or the status of the certificate is invalid.The specified certificate does not exist or the certificate status is invalid.
400Certificate.KeyNullThe private key is required.The private key is not specified.
400Key.MalformedThe specified Key format is invalid.The Key parameter is set in an invalid format.
400CertStorage.failedError saving the certificate.Failed to store the certificate.
400CertificateContent.DuplicatedThe certificate has been uploaded; do not upload again.The specified certificate has been uploaded. Do not upload the certificate again.
400Certificate.ExpiredThe certificate has expired.The certificate has expired.
400InvalidDomain.notOnlineThe domain is offline. Check the status of the domain and try again later.The specified domain name status is invalid. Check whether the domain name is online and try again later.
400Decode.ErrorError decoding the SSLPub or SSLPri certificate.The system has failed to decode the public key or the private key of the SSL certificate.
400sslPub.ErrorError encoding SSLPub.Failed to encode sslPub.
400sslPri.ErrorError encoding SSLPri.Failed to encode SSLPri.
400DomainInSafeModeThe domain is in safe mode. To request permission, contact Customer Service.The specified domain name is in the protected mode. If you must perform this operation, submit a ticket.
400CreateCertificateFailedCreate certificate failed,please try again.The certificate failed to be created. Create the certificate again.
400Abs.CertRegion.ValueNotSupportedCertRegion is not supported.The certificate region is not supported.
400CertNameAlreadyExistsThe CertName already exists.The certificate name already exists.
403DomainInProtectedModeThe domain is in protection mode. To request permission, contact Customer Service.The specified domain name is in the protected mode. If you must perform this operation, contact customer service.
404CertName.MissingParameterYou must specify CertName.Enter the certificate name.

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

Change history

Change timeSummary of changesOperation
2023-12-06The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    Error Codes 400 change
    delete Error Codes: 403
    delete Error Codes: 404
2023-09-04The Error code has changed. The request parameters of the API has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400
    delete Error Codes: 403
    delete Error Codes: 404
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: Env