Skip to main content

Require client certificates

You configure a trusted client CA for incoming TLS and verify access with and without a client certificate.

Note: Balancer is in beta. Endpoints, fields and behavior may change before general availability, and the feature must be enabled on your account before use. Contact your NetActuate account manager to request access.

Prerequisites​

  • Balancer access and a key in the BALANCER_API_KEY environment variable with permission for these operations.
  • The API host shown in the Balancer portal. Replace <your-api-host> in every example with that host.
  • A shell, curl and Python 3 for examples that build JSON from environment variables.
  • An HTTPS group and domain, a local PEM client CA bundle, and a client certificate and private key signed by that CA. Set CLIENT_CA_PEM to the CA bundle contents.

Resource identifiers come from your API responses. Set each variable when its value is available, before the first step that uses it.

Environment variableValue
CLIENT_CA_PEMYour local PEM contents.
GROUP_IDReturned resource identifier, or your selected scope identifier.
HTTP_LB_IDReturned resource identifier, or your selected scope identifier.

For an identifier, enter the value returned for your resource and export it:

read -r -p 'GROUP_ID: ' GROUP_ID
export GROUP_ID

Read your local CA bundle before configuring the group:

export CLIENT_CA_PEM="$(cat client-ca.pem)"

Steps​

  1. Require client CA validation on the group.

    python3 - <<'PYBODY' | \
    curl --silent --show-error --include \
    --request PATCH \
    --url "https://<your-api-host>/http-loadbalancers/$HTTP_LB_ID/groups/$GROUP_ID" \
    --header "x-api-key: $BALANCER_API_KEY" \
    --header "Content-Type: application/json" \
    --data-binary @-
    import json, os
    print(json.dumps({'downstreamCaCertificate': os.environ['CLIENT_CA_PEM']}))
    PYBODY

    API reference: Update an HTTP group configuration

    Expected: HTTP 200. The following shows the response fields to check; additional data depends on your saved resources. Resource identifiers are illustrative.

    {
    "code": 200,
    "result": "success",
    "data": {
    "groupId": 1
    }
    }
  2. Read the group configuration.

    curl --silent --show-error --include \
    --request GET \
    --url "https://<your-api-host>/http-loadbalancers/$HTTP_LB_ID/groups/$GROUP_ID" \
    --header "x-api-key: $BALANCER_API_KEY"

    API reference: Get HTTP group

    Expected: HTTP 200. The following shows the response fields to check; additional data depends on your saved resources. Resource identifiers are illustrative.

    {
    "code": 200,
    "result": "success",
    "data": {
    "groupId": 1
    }
    }

Verify​

Test https://example.com without a client certificate, then with the authorized client certificate. The first connection should fail client CA validation during TLS. The second should complete TLS and reach the configured HTTP behavior. A TLS rejection need not include an HTTP status.

Use your configured site domain in this traffic check:

curl --silent --show-error --include "https://example.com/"

Expected: the site behavior described above. The application response body and status depend on your origin and selected policies.

Repeat with your local client material:

curl --silent --show-error --include \
--cert client-certificate.pem \
--key client-private-key.pem \
"https://example.com/"

Expected: TLS succeeds for a trusted client, followed by the configured application response.

An API mutation saves desired configuration first. Readback and a live traffic check answer different questions. No fixed propagation time is established.

The mtlsClientCertificateId field selects a client certificate for connections toward the origin. It does not require incoming clients to present certificates.

Troubleshooting​

SymptomCauseFix
Valid client fails TLSWrong trust bundle or certificate chainCheck the client issuer and supplied chain.
Origin authentication changes insteadAn origin client certificate was configuredUse downstreamCaCertificate for incoming TLS.
API readback succeeds but connections differServing TLS configuration has not convergedRepeat the handshake and ask support to compare deployment state.

Limits and defaults​

SettingLimit or default
Client CA bundleMaximum 32768 characters
HTTP TLS profileDefault modern; modern, compatible or legacy

API status codes​

StatusMeaning
200Request succeeds; inspect returned data.
400Invalid arguments or configuration.
401Authentication or authorization denied.
404Resource or parent is unavailable.
409Resource state conflicts with the operation.
412Inspect the returned error details.
500The request encounters a server error.
  • DELETE /mtls-certificates/{mtlsCertificateId}
  • GET /http-loadbalancers/{httpLbId}/groups/{groupId}
  • GET /mtls-certificates
  • GET /mtls-certificates/{mtlsCertificateId}
  • PATCH /http-loadbalancers/{httpLbId}/groups/{groupId}
  • POST /mtls-certificates

API reference​

Need Help?​

Contact your account manager or use the Balancer portal.