API7 Docs

Update an SSL certificate on a gateway group

PUT /apisix/admin/ssls/{ssl_id}

Deprecated

PUT /apisix/admin/ssls/{ssl_id}

Interactive request editor loads with JavaScript.

Authorization

X-API-KEY<token>

In: header

Path Parameters

ssl_id*string

The unique identifier of the SSL object.

Match^[a-zA-Z0-9-_.]+$
Length1 <= length <= 256

Query Parameters

gateway_group_id*string

Gateway group ID. Optional when using the gateway group admin key to authenticate.

Length1 <= length

Request Body

application/json

The SSL certificate description.

Response Body

application/json

application/json

curl -X PUT "$API_BASE_URL/apisix/admin/ssls/bd58fce2-b6cc-4d2d-a53c-6ce11b19c101?gateway_group_id=86fb9981-d9d2-4555-9df8-91ae92129335" \  -H "Content-Type: application/json" \  -d '{}'

SSL certificate updated successfully.

{
  "value": {
    "name": "us-west-rsc",
    "desc": "Object description.",
    "snis": [
      "httpbin.org"
    ],
    "client": {
      "ca": "-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----",
      "skip_mtls_uri_regex": [
        "string"
      ]
    },
    "type": "server",
    "labels": {
      "version": "v2",
      "env": "prod"
    },
    "id": "bd58fce2-b6cc-4d2d-a53c-6ce11b19c101",
    "created_at": 1742288232,
    "updated_at": 1742288235,
    "exptime": 1735680000,
    "validity_start": 1714540800,
    "validity_end": 1730419200
  }
}
Complete operation details and schema variants

PUT /apisix/admin/ssls/{ssl_id}

Update an SSL certificate on a gateway group

IAM Action: gateway:UpdateSSLCertificate, Resource: arn:api7:gateway:gatewaygroup/%s

Parameters

  • ssl_id (path, string, required): The unique identifier of the SSL object.
  • gateway_group_id (query, string, required): Gateway group ID. Optional when using the gateway group admin key to authenticate.

Request body

Content type: application/json

  • allOf variant 1
  • name (string, optional): The object name.
  • desc (string, optional): The object description.
  • snis (array, optional): The SNI list for matching the SSL certificate.
  • client (object, optional): Client certificate.
  • client.ca (string, required): Client CA certificate in PEM format.
  • client.skip_mtls_uri_regex (array, optional): URI regular expressions to skip mTLS verification. Requests matching any of these patterns will bypass client certificate verification.
  • type (string, optional): Type of certificate. Only support server at the moment, which represents certificates used by the Gateway to verify client requests.
  • labels (object, optional): Key-value pairs of labels.
  • allOf variant 2
  • key (string, optional): Private key content or reference to the private key content.
  • oneOf variant 1: Private Key Reference
  • oneOf variant 2: Private Key Content
  • cert (string, optional): Certificate content or reference to the certificate content.
  • oneOf variant 1: Certificate Reference
  • oneOf variant 2: Certificate Content
  • keys (array, optional): An array of additional private key content or reference to the private key content. Each item is the private key of the certificate at the same position in certs, so keys and certs must have the same number of items.
  • oneOf variant 1: Private Key Reference
  • oneOf variant 2: Private Key Content
  • certs (array, optional): An array of additional certificate content or reference to the certificate content. Use it to serve several certificates with different key types (for example RSA and ECDSA) on the same SNI.
  • oneOf variant 1: Certificate Reference
  • oneOf variant 2: Certificate Content
  • anyOf variant 1: Use Key and Cert
  • anyOf variant 2: Use Keys and Certs

Responses

  • 200: SSL certificate updated successfully.
  • allOf variant 1
  • value (object, optional): The specific resource.
  • allOf variant 2
  • value (object, optional): The SSL response format, with filtering the sensitive fields and some other fields.
  • allOf variant 1
  • value.name (string, optional): The object name.
  • value.desc (string, optional): The object description.
  • value.snis (array, optional): The SNI list for matching the SSL certificate.
  • value.client (object, optional): Client certificate.
  • value.client.ca (string, required): Client CA certificate in PEM format.
  • value.client.skip_mtls_uri_regex (array, optional): URI regular expressions to skip mTLS verification. Requests matching any of these patterns will bypass client certificate verification.
  • value.type (string, optional): Type of certificate. Only support server at the moment, which represents certificates used by the Gateway to verify client requests.
  • value.labels (object, optional): Key-value pairs of labels.
  • allOf variant 2
  • value.id (string, optional): The object ID.
  • value.created_at (integer, optional): The object created timestamp.
  • value.updated_at (integer, optional): The object updated timestamp.
  • value.exptime (integer, optional): The SSL certificate expire time.
  • value.validity_start (integer, optional): The earliest time when the SSL certificate is used.
  • value.validity_end (integer, optional): The latest time when the SSL certificate is used.
  • 400: Bad Request — The request was malformed or contained invalid parameters. Check the error_msg field for details.
  • value (object, optional): The specific resource.
  • error_msg (string, optional): The error message.

cURL

curl -X PUT '$API_BASE_URL/apisix/admin/ssls/{ssl_id}'