You can call this operation to enable or disable the SSL certificate for a specified domain name and modify the certificate information.

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 Type Required Example Description
Action String Yes SetDcdnDomainCertificate

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

DomainName String Yes example.com

The name of the accelerated domain. You can specify only one domain name.

The specified accelerated domain must have HTTPS acceleration enabled.

SSLProtocol String Yes on

Specifies whether to enable the SSL certificate. Valid values:

  • on: enables the SSL certificate.
  • off: disables the SSL certificate. Default value: off.
CertName String No yourCertName

The name of the certificate.

CertType String No cas

The type of the certificate. Valid values:

  • upload: a local certificate
  • cas: a certificate issued by SSL Certificates Service
  • free: a free certificate
ForceSet String No 1

Specifies whether to check the certificate name for duplicates. If you set the value to 1, the system does not perform the check and overwrites the information of the existing certificate with the same name.

Region String No cn-shanghai

The region information. Default value: ch-hangzhou.

SSLPri String No SSLPri

The private key. Specify this parameter only if you enable the SSL certificate.

SSLPub String No SSLPub

The content of the certificate. Specify this parameter only if you enable the SSL certificate.

Response parameters

Parameter Type Example Description
RequestId String 0AEDAF20-4DDF-4165-8750-47FF9C1929C9

The ID of the request.

Examples

Sample requests

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

Sample success responses

XML format

<SetDcdnDomainCertificateResponse>
	  <RequestId>0AEDAF20-4DDF-4165-8750-47FF9C1929C9</RequestId>
</SetDcdnDomainCertificateResponse>

JSON format

{
	"RequestId":"0AEDAF20-4DDF-4165-8750-47FF9C1929C9"
}

Error codes

HTTP status code Error code Error message Description
400 InvalidSSLProtocol.ValueNotSupported The specified SSLProtocol is invalid. The error message returned because the specified SSLProtocol parameter is invalid. Set the SSLProtocol parameter to on or off.
400 SSLPub.MissingParameter The SSLPub parameter is required. The error message returned because the SSLPub parameter must be specified.
400 SSLPri.MissingParameter The SSLPri parameter is required. The error message returned because the SSLPri parameter must be specified.
400 InvalidSSLPub The specified SSLPub is invalid. The error message returned because the specified SSLPub parameter is invalid.
400 InvalidSSLPri The specified SSLPri is invalid. The error message returned because the specified SSLPri parameter is invalid.
400 Certificate.MissMatch The SSLPri does not match the certificate. The error message returned because the specified certificate and private key do not match.
400 InvalidCertificate.TooLong The maximum length of the certificate is exceeded. The error message returned because the length of the specified certificate exceeds the upper limit.
400 InvalidCertName.TooLong The length of the certificate name cannot exceed 128 characters. The error message returned because the length of the specified certificate name cannot exceed 128 characters.
400 IllegalOperationDomain You are not authorized to operate the domain. The error message returned because you are not authorized to manage the domain.
400 AuthenticationFailed Error performing verification. The error message returned because the verification has failed.
400 SetDomainCertificate.ParameterError The specified parameters are invalid. The error message returned because the specified parameters are invalid.
400 Certificate.StatusError The status of the certificate is invalid. The error message returned because the certificate status is invalid.
400 DeleteFailed Error deleting the certificate. The error message returned because the system has failed to delete the specified certificate.
400 Certificate.NotFind The certificate does not exist. The error message returned because the specified certificate does not exist.
400 Certificate.Duplicated The certificate name already exists. The error message returned because the certificate already exists.
400 Certificate.FormatError The format of the certificate is invalid. The error message returned because the certificate format is invalid.
400 Certificate.StatusError The certificate does not exist, or the status of the certificate is invalid. The error message returned because the specified certificate does not exist or the certificate status is invalid.
400 Certificate.KeyNull The private key is required. The error message returned because the private key must be specified.
400 Key.Malformed The specified Key format is invalid. The error message returned because the specified Key parameter is invalid.
400 CertStorage.failed Error saving the certificate. The error message returned because the system has failed to save the certificate.
400 CertificateContent.Duplicated The certificate has been uploaded; do not upload again. The error message returned because the certificate has been uploaded.
400 Certificate.Expired The certificate has expired. The error message returned because the certificate has expired.
400 InvalidDomain.notOnline The domain is offline. Check the status of the domain and try again later. The error message returned because the specified domain is offline.
400 Decode.Error Error decoding the SSLPub or SSLPri certificate. The error message returned because the public key or the private key of the certificate has failed to be decoded.
400 sslPub.Error Error encoding SSLPub. The error message returned because the system has failed to encode the public key of the certificate.
400 sslPri.Error Error encoding SSLPri. The error message returned because the system has failed to encode the private key of the certificate.
400 DomainInSafeMode The domain is in safe mode. To request permission, contact Customer Service. The error message returned because the domain name is in security mode. To call this operation, submit a ticket.
403 DomainInProtectedMode The domain is in protection mode. To request permission, contact Customer Service. The error message returned because the specified domain is being protected. To call this operation, contact Customer Service.

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