Configures an HTTPS certificate for one or more accelerated domain names.

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 BatchSetDcdnDomainCertificate

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

DomainName String Yes **example**.com

The name of the accelerated domain for which you want to configure the HTTPS certificate. The accelerated domain must have HTTPS acceleration enabled. You can specify multiple domain names and separate them with commas (,).

SSLProtocol String Yes on

Specifies whether to enable the HTTPS certificate. Valid values:

  • on: enables the certificate.
  • off: disables the certificate.

Default value: off.

CertName String No cert-te**.com

The name of the certificate.

CertType String No cas

The type of the certificate. Valid values:

  • upload: a custom certificate that you upload.
  • cas: a certificate that is purchased from Alibaba Cloud SSL Certificates Service.
SSLPub String No x****

The content of the certificate. This parameter is required only if you enable the certificate.

SSLPri String No y****

The private key. This parameter is required only if you enable the certificate.

Region String No cn-hangzhou

The region information.

Response parameters

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

The ID of the request.

Examples

Sample requests

http(s)://dcdn.aliyuncs.com/? Action=BatchSetDcdnDomainCertificate
&DomainName=**example**.com
&SSLProtocol=on
&<Common request parameters>

Sample success responses

XML format

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

JSON format

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

Error codes

HttpCode 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.
404 CertName.MissingParameter You must specify CertName. The error message returned because the CertName parameter must be specified.
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 SSLPub and SSLPri parameters 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 specified domain name.
400 AuthenticationFailed Error performing verification. The error message returned because the identity 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 state 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 specified 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 state is invalid.
400 Certificate.KeyNull The private key is required. The error message returned because the private key must be specified.
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 name is offline.
400 Decode.Error Error decoding the SSLPub or SSLPri certificate. The error message returned because the system has failed to decode the public key or the private key of the certificate.
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 specified domain is in safe 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.
400 InvalidDomainNumber.TooLong The maximum number of DomainNumber is 50. The error message returned because the number of the specified domain names exceeds 50.

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