Help Center/ Virtual Private Network/ API Reference/ API/ P2C VPN APIs/ Server/ Uploading a Client CA Certificate
Updated on 2024-07-29 GMT+08:00

Uploading a Client CA Certificate

Function

This API is used to upload a client CA certificate.

Calling Method

For details, see Calling APIs.

URI

POST /v5/{project_id}/p2c-vpn-gateways/vpn-servers/{vpn_server_id}/client-ca-certificates
Table 1 Parameter description

Parameter

Type

Mandatory

Description

project_id

String

Yes

Specifies a project ID. You can obtain the project ID by referring to Obtaining the Project ID.

vpn_server_id

String

Yes

Specifies the ID of a VPN server.

Table 2 Parameters in the request header

Parameter

Type

Mandatory

Description

X-Client-Token

String

No

  • Specifies the ID of an idempotent request.
  • The value is a UUID containing 36 characters.

Request

  • Request parameters
    Table 3 Request parameters

    Parameter

    Type

    Mandatory

    Description

    client_ca_certificate

    client_ca_certificate object

    Yes

    Specifies client CA certificate information.

    Table 4 client_ca_certificate

    Parameter

    Type

    Mandatory

    Description

    name

    String

    No

    • Specifies a certificate name. If this parameter is left blank, the system automatically generates a certificate name.
    • The value is a string of 1 to 64 characters, which can contain digits, letters, underscores (_), and hyphens (-).

    content

    String

    Yes

    • Specifies the certificate content. It is recommended to use a certificate with a strong cryptographic algorithm, such as RSA-3072 or RSA-4096.
    • Format:

      -----BEGIN CERTIFICATE-----

      *************************************

      *************************************

      -----END CERTIFICATE-----

  • Example request
    POST https://{Endpoint}/v5/{project_id}/p2c-vpn-gateways/vpn-servers/{vpn_server_id}/client-ca-certificates
    
    {
      "client_ca_certificate": {
        "name": "client_ca_8sux3d",
        "content": "-----BEGIN CERTIFICATE-----********-----END CERTIFICATE-----"
      }
    }

Response

  • Response parameters

    Returned status code 201: successful operation

    Table 5 Parameters in the response body

    Parameter

    Type

    Description

    client_ca_certificate

    client_ca_certificate object

    Specifies the client CA certificate object.

    request_id

    String

    Specifies a request ID.

    Table 6 client_ca_certificate

    Parameter

    Type

    Description

    id

    String

    • Specifies the ID of a client CA certificate.
    • The value is a UUID containing 36 characters.
    • Example response
      {
          "client_ca_certificate": {
              "id": "4e3a364f-1213-4a37-917e-d494aeada34e"
          },
          "request_id": "4114fdd9ca33e22936ece75b97d7a363"
      }

Status Codes

For details, see Status Codes.