Certificates

Create a new Certificate

Changed on

Create a new Certificate

post/{workspace}/certificates

Request

  • Base URL
    http://localhost:8001
  • Auth
    API key in header Kong-Admin-Token

Path parameters

workspace, string required
Example:team-payments

The name of the workspace

Request body

Certificate required

A certificate object represents a public certificate, and can be optionally paired with the corresponding private key. These objects are used by Kong to handle SSL/TLS termination for encrypted requests, or for use as a trusted CA store when validating peer certificate of client/service. Certificates are optionally associated with SNI objects to tie a cert/key pair to one or more hostnames. If intermediate certificates are required in addition to the main certificate, they should be concatenated together into one string according to the following order: main certificate on the top, followed by any intermediates.

cert, string required

PEM-encoded public certificate chain of the SSL key pair. This field is referenceable, which means it can be securely stored as a secret in a vault. References must follow a specific format.

cert_alt, string nullable

PEM-encoded public certificate chain of the alternate SSL key pair. This should only be set if you have both RSA and ECDSA types of certificate available and would like Kong to prefer serving using ECDSA certs when client advertises support for it. This field is referenceable, which means it can be securely stored as a secret in a vault. References must follow a specific format.

created_at, integer nullable

Unix epoch when the resource was created.

id, string nullable

A string representing a UUID (universally unique identifier).

key, string required

PEM-encoded private key of the SSL key pair. This field is referenceable, which means it can be securely stored as a secret in a vault. References must follow a specific format.

key_alt, string nullable

PEM-encoded private key of the alternate SSL key pair. This should only be set if you have both RSA and ECDSA types of certificate available and would like Kong to prefer serving using ECDSA certs when client advertises support for it. This field is referenceable, which means it can be securely stored as a secret in a vault. References must follow a specific format.

snis, string[] nullable
tags, string[] nullable

An optional set of strings associated with the Certificate for grouping and filtering.

updated_at, integer nullable

Unix epoch when the resource was last updated.

Example request

{
  "cert": "-----BEGIN CERTIFICATE-----\ncertificate-content\n-----END CERTIFICATE-----",
  "id": "b2f34145-0343-41a4-9602-4c69dec2f269",
  "key": "-----BEGIN PRIVATE KEY-----\nprivate-key-content\n-----END PRIVATE KEY-----"
}

Response

Successfully created Certificate

Certificate required

A certificate object represents a public certificate, and can be optionally paired with the corresponding private key. These objects are used by Kong to handle SSL/TLS termination for encrypted requests, or for use as a trusted CA store when validating peer certificate of client/service. Certificates are optionally associated with SNI objects to tie a cert/key pair to one or more hostnames. If intermediate certificates are required in addition to the main certificate, they should be concatenated together into one string according to the following order: main certificate on the top, followed by any intermediates.

cert, string required

PEM-encoded public certificate chain of the SSL key pair. This field is referenceable, which means it can be securely stored as a secret in a vault. References must follow a specific format.

cert_alt, string nullable

PEM-encoded public certificate chain of the alternate SSL key pair. This should only be set if you have both RSA and ECDSA types of certificate available and would like Kong to prefer serving using ECDSA certs when client advertises support for it. This field is referenceable, which means it can be securely stored as a secret in a vault. References must follow a specific format.

created_at, integer nullable

Unix epoch when the resource was created.

id, string nullable

A string representing a UUID (universally unique identifier).

key, string required

PEM-encoded private key of the SSL key pair. This field is referenceable, which means it can be securely stored as a secret in a vault. References must follow a specific format.

key_alt, string nullable

PEM-encoded private key of the alternate SSL key pair. This should only be set if you have both RSA and ECDSA types of certificate available and would like Kong to prefer serving using ECDSA certs when client advertises support for it. This field is referenceable, which means it can be securely stored as a secret in a vault. References must follow a specific format.

snis, string[] nullable
tags, string[] nullable

An optional set of strings associated with the Certificate for grouping and filtering.

updated_at, integer nullable

Unix epoch when the resource was last updated.

Example response

{
  "cert": "-----BEGIN CERTIFICATE-----\ncertificate-content\n-----END CERTIFICATE-----",
  "id": "b2f34145-0343-41a4-9602-4c69dec2f269",
  "key": "-----BEGIN PRIVATE KEY-----\nprivate-key-content\n-----END PRIVATE KEY-----"
}

Changes