Baidu AI Cloud
中国站

百度智能云

CDN

Batch Upload of Certificates

Interface Description

This interface is used to upload https certificates in batches.

Notes:

If the domain has been bound to a certificate id, the interface is modified. Replace the old certificate in the certificate library with the new one uploaded by the user, and bind the id of the new certificate to the domain). If the domain is not bound to a certificate, the interface is used to upload a new certificate and bind the new certificate id to the domain. This interface does not process the old certificate in the certificate library after replacing the old one.

method path Description
POST /v2/domain/certificate?action=put Add or modify the certificate bound to the domain.

Request Body

Parameters Optional Type Description
domains Required list The list of domain names to be configured cannot exceed 100 domain names.
certificate Required certificate Certificate content
https Optional https Https related configurations

Certificate Type Description

Parameters Optional Type Description
certName Required string Name of Certificate. The length is limited to 1-65 characters, starting with a letter. It can only contain letters, numbers, and such symbols as '-', '/', '.', ‘,’, or '*'. The Java regular expression is ^[a-zA-Z][a-za-z0-9\-/_\.\*]{0,64}$
certServerData Required string Data content of the server certificate (Base64 encoded)
certPrivateData Required string Private key data content of the certificate (Base64 encoded)
certLinkData Optional string Certificate chain data content (Base64 encoded)
certType Optional int The certificate type, whose value is 1, indicating the server certificate. The client certificate cannot be passed.

https Type Description

Parameters Optional Type Description
httpRedirect Optional bool When it is true, redirect the HTTP request to HTTPS (the redirection status code is configured by httpRedirectCode), the default value is false. In the case of enabled=false, this item is invalid, and it cannot be true at the same time as httpsRedirect.
httpRedirectCode Optional int Redirection status code. The optional value is 301/302. The default value is 302. In the case of enabled=false, this item is invalid. In the case of httpRedirect=false, this item is invalid.
httpsRedirect Optional bool When it is true, redirect the HTTPS request to HTTP (the redirection status code is configured by httpsRedirectCode), the default value is false. In the case of enabled=false, this item is invalid, and it cannot be true at the same time as httpRedirect.
httpsRedirectCode Optional int Redirection status code. The optional value is 301/302. The default value is 302. In the case of enabled=false, this item is invalid. In the case of httpsRedirect=false, this item is invalid.
http2Enabled Optional bool Enable the HTTP2 feature. The default is true. When enabled=false, this item is invalid.
disableHttpsSpider Optional string Exclude requests that contain the ua value of the field during redirection.

Response Body

Parameters Optional Type Description
certId Required string CertId after the certificate is stored

Request Example

POST /v2/domain/certificate?action=put
{
    "domains": [
        "*.a.test.top",
        "b.test.top"
    ],
    "certificate": {
        "certName": "test",
        "certServerData": "-----BEGIN CERTIFICATE-----END CERTIFICATE-----",
        "certPrivateData": "-----BEGIN RSA PRIVATE KEY-----END RSA PRIVATE KEY-----"
    }
}

Response Example

{"certId":"cert-z086cxsudg2k"}
Previous
Certificate Association Operation
Next
Query Enabled Https Domain Name