tencent cloud

Tencent Cloud EdgeOne

ModifyHostsCertificate

ダウンロード
フォーカスモード
フォントサイズ
最終更新日: 2026-11-25 17:00:10

1. API Description

Domain name for API request: teo.intl.tencentcloudapi.com.

After domain name creation is completed, you can configure a self-owned certificate for the domain name, or alternatively use the free certificate (https://www.tencentcloud.com/document/product/1552/90437?from_cn_redirect=1) offered by EdgeOne.
If you need to configure a self-owned certificate, upload the certificate to the SSL certificate console first, then import the corresponding certificate ID in this API. For details, see [Deploy self-owned certificates to EdgeOne domain names].
](https://www.tencentcloud.com/document/product/1552/88874?from_cn_redirect=1).

A maximum of 20 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: ModifyHostsCertificate.
Version Yes String Common Params. The value used for this API: 2022-09-01.
Region No String Common Params. This parameter is not required.
ZoneId Yes String Zone ID.
Hosts.N Yes Array of String Acceleration domain name whose certificate configuration needs to be modified.
Mode No String Mode for configuring the server certificate. Valid values:
  • eofreecert_manual: deploy a free certificate applied through DNS delegated verification or file validation. Before deploying the free certificate, you need to trigger the Apply for Free Certificate API to apply for a free certificate. After a successful application, you can use this enumeration value to deploy the free certificate;

    • Note: When deploying a free certificate, ensure that a successfully applied free certificate already exists. You can check whether a successfully applied free certificate already exists through the Check Free Certificate Application Result API.

  • sslcert: Configure an SSL managed service side certificate.
  • ServerCertInfo.N No Array of ServerCertInfo SSL certificate configuration. This parameter is effective only when the mode is sslcert. You only need to provide the CertId of the corresponding certificate. You can check the CertId from the SSL Certificate List.
    ClientCertInfo No MutualTLS In the mutual authentication scenario, this field represents the client's CA certificate, which is deployed inside the EO node and used for the client to authenticate the EO node. By default, it is disabled. If it is left blank, it indicates retaining the original configuration.
    UpstreamCertInfo No UpstreamCertInfo Used to enable or disable origin-pull mutual authentication and origin certificate verification respectively. Off by default. Leave blank to indicate retaining the original configuration. The origin-pull mutual authentication configuration is currently in internal allowlist testing. If needed, contact us (https://www.tencentcloud.com/online?from_cn_redirect=1-service).

    3. Output Parameters

    Parameter Name Type Description
    RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

    4. Example

    Example1 Configuring an SSL Certificate

    This example shows you how to configure an SSL certificate (CertId is J2JqATrt) for the domain name (abc.test.com) under the site (ZoneId is zone-2fgd17m17xw).

    Input Example

    POST / HTTP/1.1
    Host: teo.intl.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: ModifyHostsCertificate
    <Common request parameters>
    
    {
        "ZoneId": "zone-2fgd17m17xw",
        "Hosts": [
            "abc.test.com"
        ],
        "Mode": "sslcert",
        "ServerCertInfo": [
            {
                "CertId": "J2JqATrt"
            }
        ]
    }

    Output Example

    {
        "Response": {
            "RequestId": "5e5a0d0f-52f3-4bad-9bd3-dcf1d5c954e7"
        }
    }

    Example2 Configuring a Free Certificate

    This example shows you how to configure a free certificate for the domain name (abc.test.com) under the site (ZoneId is zone-2fgd17m17xw).

    Input Example

    POST / HTTP/1.1
    Host: teo.intl.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: ModifyHostsCertificate
    <Common request parameters>
    
    {
        "ZoneId": "zone-2fgd17m17xw",
        "Hosts": [
            "abc.test.com"
        ],
        "Mode": "eofreecert"
    }

    Output Example

    {
        "Response": {
            "RequestId": "084d5612-67a7-4aca-aac9-827aa3662b2d"
        }
    }

    Example3 Configuring the edge mutual authentication

    This example shows you how to configure the edge mutual authentication (CertId is J2JqATrt) for the domain name (abc.test.com) under the site (ZoneId is zone-2fgd17m17xw).

    Input Example

    POST / HTTP/1.1
    Host: teo.intl.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: ModifyHostsCertificate
    <Common request parameters>
    
    {
        "ZoneId": "zone-2fgd17m17xw",
        "Hosts": [
            "abc.test.com"
        ],
        "ClientCertInfo": {
            "Switch": "on",
            "CertInfos": [
                {
                    "CertId": "J2JqATrt"
                }
            ]
        }
    }

    Output Example

    {
        "Response": {
            "RequestId": "5e5a0d0f-52f3-4bad-9bd3-dcf1d5c954e7"
        }
    }

    5. Developer Resources

    SDK

    TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

    Command Line Interface

    6. Error Code

    The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

    Error Code Description
    FailedOperation Operation failed.
    FailedOperation.CertificateHasExpired The edge HTTPS certificate has expired. Issuing expired certificates is currently not supported.
    FailedOperation.CertificateNotFound The edge HTTPS certificate does not exist.
    FailedOperation.EdgeClientCertificateHasExpired The edge client certificate has expired. It is not supported to issue expired certificates for the time being.
    FailedOperation.InvalidZoneStatus Site status incorrect.
    FailedOperation.ModifyFailed Operation failed.
    FailedOperation.UpstreamClientCertificateHasExpired The client certificate for the origin-pull mutual authentication has expired. It is not supported to issue expired certificates.
    FailedOperation.UpstreamVerifyCustomCACertificateHasExpired The origin CA certificate has expired. Issuing expired certificates is currently not supported.
    InternalError.ConfigLocked The configuration has been locked. Unlock it and retry.
    InternalError.GetRoleError Failed to obtain role.
    InternalError.ProxyServer Unknown error occurs on the real server.
    InternalError.RouteError Backend service routing address error.
    InternalError.SystemError Internal error. System error.
    InternalError.UnknowError Unknown error.
    InvalidParameter.ActionInProgress Operations are too frequent. Please try again later.
    InvalidParameter.AliasDomainNotSupportKeyless Alias domain names do not support configuring a keyless certificate.
    InvalidParameter.CertNotMatchDomain Invalid edge HTTPS certificate configuration. The certificate does not match the domain name.
    InvalidParameter.CertSANTooLong The total length of SAN domain names in the cert exceeds the limit (maximum 4096 bytes).
    InvalidParameter.CertToExpire The edge HTTPS certificate is about to expire.
    InvalidParameter.CertTooShortKeySize Invalid edge HTTPS certificate configuration. The key length does not meet the minimum requirement RSA>=2048, DSA>=2048, DH>=2048, and EC>=225.
    InvalidParameter.CertificateConflictWithKeylessServer The domain name to be changed is not bound to a certificate or keyless server. Please bind it first and then proceed.
    InvalidParameter.CnameWildHostNotAllowApplyCertificate A wildcard domain name certificate cannot be applied for in CNAME mode.
    InvalidParameter.EdgeClientCertCheckError Invalid edge client certificate configuration.
    InvalidParameter.HostStatusNotAllowApplyCertificate CNAME not switched or origin not routed to the EO server.
    InvalidParameter.InvalidCertInfo Invalid edge HTTPS certificate information.
    InvalidParameter.InvalidHttpsCertInfo Invalid edge HTTPS certificate configuration. The certificate content is invalid.
    InvalidParameter.InvalidHttpsTlsVersion Invalid HTTPS TLS version.
    InvalidParameter.UpstreamClientCertCheckError Invalid origin-pull client certificate configuration.
    InvalidParameter.UpstreamVerifyCertCheckError Invalid origin certificate verification configuration.
    InvalidParameter.UpstreamVerifyCustomCACertNoInfo Invalid origin certificate verification configuration. The certificate content is empty.
    InvalidParameter.ZoneIsGrayPublishing Site is upgrading. Changes are not currently supported. Try again later.
    InvalidParameterValue.AliasDomainNotSupportEdgeMTLS Alias domain names do not support the configuration of edge mutual authentication for the time being.
    InvalidParameterValue.AliasDomainNotSupportUpstreamMTLS Alias domain names do not support the configuration of origin-pull mutual authentication for the time being.
    InvalidParameterValue.AliasDomainNotSupportUpstreamVerify Alias domain names do not support the configuration of origin certificate verification for the time being.
    InvalidParameterValue.CertificateVerifyClientMustCa The client certificate in the edge mutual authentication configuration must be a CA certificate.
    InvalidParameterValue.CertificateVerifyClientNeedCert Edge mutual authentication configuration requires at least one certificate.
    InvalidParameterValue.CertificateVerifyUpstreamClientMustRSAorECC Currently, only RSA or ECC algorithm certificates are supported for the origin-pull mutual authentication, and the SCA SM2 algorithm certificates are not supported.
    InvalidParameterValue.CertificateVerifyUpstreamClientMustSVR The certificate type for the origin-pull mutual authentication is incorrect and cannot be configured as a CA certificate.
    InvalidParameterValue.CertificateVerifyUpstreamClientNeedCert Origin-pull mutual authentication configuration requires at least one certificate.
    InvalidParameterValue.CertificateVerifyUpstreamVerifyCustomCAMustCA The certificate type for origin certificate verification is incorrect. Only CA certificates are supported.
    InvalidParameterValue.CertificateVerifyUpstreamVerifyCustomCAMustRSAorECC Currently, only RSA or ECC algorithm certificates are supported for origin certificate verification, and SCA SM2 algorithm certificates are not supported.
    InvalidParameterValue.CertificateVerifyUpstreamVerifyCustomCANeedCert Origin certificate verification configuration requires at least one certificate.
    InvalidParameterValue.ClientCertInfoQuotaLimit A maximum of 20 client CA certificates can be configured in the edge mutual authentication configuration.
    InvalidParameterValue.InvalidKeylessServerId Invalid keyless server ID.
    InvalidParameterValue.OCDirectOriginDomainNotSupportUpstreamVerify OC switching does not support enabling origin certificate verification.
    InvalidParameterValue.ServerCertInfoNeedContainRSAorECC Edge mTLS is enabled. When the client uses an RSA or ECC algorithm certificate, the same algorithm certificate should also be configured in the edge HTTPS certificate.
    InvalidParameterValue.ServerCertInfoNeedContainSM2 Edge mTLS is enabled. When the client uses a national encryption CA certificate, the national encryption certificate should also be configured in the edge HTTPS certificate.
    InvalidParameterValue.SiteFailoverNotSupportHostUpstreamVerify Enabling origin server failover and origin-pull mutual authentication/origin certificate verification simultaneously is not supported.
    InvalidParameterValue.UpstreamClientCertInfoQuotaLimit One client certificate is allowed at most in the origin-pull mutual authentication configuration.
    InvalidParameterValue.UpstreamVerifyCustomCACertInfoQuotaLimit A maximum of 1 CA certificate can be configured for origin certificate verification.
    LimitExceeded.RateLimitExceeded The request frequency reaches the limit per unit time.
    OperationDenied Operation denied.
    OperationDenied.CertificatePrivateKeyIsEmpty Currently, only the keyless certificate mode allows the private key of the certificate to be empty.
    OperationDenied.ConfigLocked The configuration has been locked. Unlock it and retry.
    OperationDenied.DisableZoneNotCompleted Site disabling not complete. Try again later.
    OperationDenied.ErrZoneIsAlreadyPaused Site disabled. Turn it on and try again.
    OperationDenied.HostsCertificateInconsistency The edge HTTPS certificate of the domain name to be changed is inconsistent. Please confirm that the domain name certificates are consistent and retry.
    OperationDenied.HostsClientCertificateInconsistency The edge mutual authentication certificates for the domain name to be changed are inconsistent. Please confirm that the domain name certificates are consistent and try again.
    OperationDenied.HostsKeylessServerInconsistency The keyless server of the domain name to be changed is inconsistent. Please confirm that the keyless server is consistent before retrying.
    OperationDenied.HostsUpstreamCertificateInconsistency The origin-pull mutual authentication certificates for the domain name to be changed are inconsistent. Please confirm that the domain name certificates are consistent and try again.
    OperationDenied.HostsUpstreamCertificateVerifyInconsistency The origin certificate verification configuration of the domain name to be changed is inconsistent. Please confirm that the domain name configuration is consistent and try again.
    OperationDenied.KeylessCertSwitchToFreeCertConflict The domain name to be changed has a different certificate or keyless server. Please confirm that the edge HTTPS certificate or keyless server is consistent before retrying.
    OperationDenied.KeylessModeCertificatePrivateKeyNeedEmpty The keyless certificate mode requires the private key of the certificate to be empty.
    OperationDenied.NotInKeylessWhiteList Currently, the keyless certificate feature is available only to users in the allowlist.
    OperationDenied.NotInUpstreamMTLSWhiteList The current origin-pull mutual authentication feature is only available to allowlist users.
    OperationDenied.UnSupportToCloseUpstreamMTLS Disabling the origin-pull mutual authentication is not supported now. To disable it, please change the edge HTTPS certificate configuration to 'none'.
    OperationDenied.UseUpstreamMTLSNeedOpenHttps To enable the origin-pull mutual authentication, please configure the edge HTTPS certificate first.
    OperationDenied.VersionControlIsGraying A test version is in use. Publish the test version to the production environment or roll back the test version and try again.
    ResourceInUse The resource is occupied.
    ResourceUnavailable.CertNotFound The cert does not exist or is unauthorized.
    ResourceUnavailable.HostNotFound Domain name not found or proxy not enabled.
    ResourceUnavailable.ZoneNotFound The site does not exist or does not belong to this account.
    UnauthorizedOperation.CamUnauthorized Unauthorized Cam operation.

    ヘルプとサポート

    この記事はお役に立ちましたか?

    フィードバック