API7 Docs

Get an SSL Certificate

GET /apisix/admin/ssls/{id}

GET /apisix/admin/ssls/{id}

Interactive request editor loads with JavaScript.

Authorization

X-API-KEY<token>

Admin API key configured in config.yaml under deployment.admin.admin_key. You can also pass the key as a query parameter api_key or cookie x_api_key.

In: header

Path Parameters

id*string

Unique identifier of the resource. Can be a string (alphanumeric, -, _, .) or a positive integer.

Response Body

application/json

application/json

application/json

curl -X GET "http://127.0.0.1:9180/apisix/admin/ssls/my-resource-1"

Successful response.

{
  "value": {
    "type": "server",
    "snis": [
      "test.com"
    ],
    "id": "1",
    "create_time": 1684373523,
    "status": 1,
    "cert": "-----BEGIN CERTIFICATE-----\nMIIDazCCAlOgAwIBAgIUJ9hQk3kXgZeZpY/m/0V6RmH1AbcwDQYJKoZIhvcNAQEL\nBQAwRTELMAkGA1UEBhMCVVMxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM\nGEludGVybmFsIFJvb3QgQ0EgKGV4YW1wbGUpMB4XDTI1MDEwMTAwMDAwMFoXDTM1\nMDEwMTAwMDAwMFowRTELMAkGA1UEBhMCVVMxEzARBgNVBAgMClNvbWUtU3RhdGUx\nITAfBgNVBAoMGEludGVybmFsIFJvb3QgQ0EgKGV4YW1wbGUpMIIBIjANBgkqhkiG\n9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4eXAMPLEcaPUBLIcfakeforopeNAPIspecON\nLYexampleCAcontentsoExpandedFakeKeyMaterial==\n-----END CERTIFICATE-----\n",
    "update_time": 1684373523
  },
  "key": "/apisix/ssls/1",
  "modifiedIndex": 133,
  "createdIndex": 133
}
Complete operation details and schema variants

GET /apisix/admin/ssls/{id}

Get an SSL Certificate

Retrieve a single SSL certificate by its ID. The private key is not included in the response.

Parameters

  • id (path, string, required): Unique identifier of the resource. Can be a string (alphanumeric, -, _, .) or a positive integer.

Responses

  • 200: Successful response.
  • key (string, required):
  • value (object, required): SSL certificate configuration for TLS termination or mTLS.

Read-only response variant: private keys (key, keys) are stripped from GET responses, so they are not present here.

  • value.id (object, optional): Unique identifier for the resource. Can be a string (1–64 characters, alphanumeric with -, _, .) or a positive integer.
  • anyOf variant 1: String ID
  • anyOf variant 2: Integer ID
  • value.desc (string, optional): Description.
  • value.labels (object, optional): Key-value pairs for categorizing and filtering resources. Values must be non-empty strings (max 256 characters).
  • value.create_time (integer, optional): Unix timestamp of creation. Read-only.
  • value.update_time (integer, optional): Unix timestamp of last update. Read-only.
  • value.type (string, optional): Certificate type.
  • value.sni (string, optional): Server Name Indication (SNI) to match. Supports wildcard prefix (*.example.com). Mutually exclusive with snis.
  • value.snis (array, optional): Multiple SNI hostnames. Mutually exclusive with sni.
  • value.cert (string, optional): PEM-encoded server certificate. Can also be a secret reference ($secret://...).
  • value.key (string, optional): PEM-encoded private key. Can also be a secret reference ($secret://...). Not returned in GET responses for security.
  • value.certs (array, optional): Additional certificates for certificate chain or alternative key types.
  • value.keys (array, optional): Additional private keys corresponding to certs.
  • value.client (object, optional): mTLS client verification settings.
  • value.client.ca (string, required): PEM-encoded CA certificate for client verification.
  • value.client.depth (integer, optional): Maximum certificate chain depth.
  • value.client.skip_mtls_uri_regex (array, optional): URI regex patterns to skip mTLS verification.
  • value.status (integer, optional): SSL status.
  • value.ssl_protocols (array, optional): Allowed TLS protocol versions.
  • createdIndex (integer, optional):
  • modifiedIndex (integer, optional):
  • 401: Unauthorized — The API key is missing, invalid, or lacks permission.
  • error_msg (string, required): Authentication error message.
  • description (string, optional): Detailed reason for the authentication failure.
  • 404: Not Found — The specified resource does not exist.
  • error_msg (string, required): Error message indicating the resource was not found.

cURL

curl -X GET 'http://127.0.0.1:9180/apisix/admin/ssls/{id}'