Skip to content

Client Certificates (mTLS)

Some APIs identify the caller by a client certificate instead of, or as well as, an API key or token. This is called mutual TLS (mTLS): during the TLS handshake the server shows its certificate and asks the caller for one too. Without a certificate the server ends the connection before any HTTP request is sent, so the check can never pass. Banking, payment and open-banking APIs, healthcare and government systems, and many company-to-company APIs work this way.

In LoadFocus you add a client certificate once for a host. From then on, every API check and every multistep step that calls that host over HTTPS sends it. There is nothing to set on each check.

Client certificates are available on the Professional plan, up to 10 per team (one per host).

  1. Open the Secrets page and scroll to Client certificates (mTLS).
  2. Click Add certificate.
  3. Enter the Host: the API's host name, for example api.partner.com. If you paste a URL, only the host name is kept. Checks to any other host never receive this certificate.
  4. Paste the Certificate (PEM): the client certificate, followed by any intermediate certificates, each starting with -----BEGIN CERTIFICATE-----.
  5. Paste the Private key (PEM). If the key is encrypted, enter its Key passphrase.
  6. Paste a Server CA certificate only if the API's own certificate is not signed by a public certificate authority (for example a partner's private CA). Leave it empty otherwise.
  7. Click Save certificate.

Before anything is stored, LoadFocus checks that the certificate and key are valid PEM, that the key belongs to the certificate, that the passphrase opens an encrypted key and that the certificate has not expired. If one of these fails, the form says which.

LoadFocus accepts PEM only. To convert a PKCS#12 file (.p12 or .pfx) with OpenSSL:

Terminal window
openssl pkcs12 -in client.p12 -clcerts -nokeys -out client-cert.pem
openssl pkcs12 -in client.p12 -nocerts -nodes -out client-key.pem

The second command writes the key without a passphrase. If the file also holds intermediate certificates, openssl pkcs12 -in client.p12 -cacerts -nokeys prints them: paste them after the client certificate. With OpenSSL 3, an older .p12 file may need -legacy added to each command. Paste the contents of the files into the form, then delete the unencrypted key file.

  • API checks whose URL starts with https:// and whose host is exactly the certificate's host.
  • Multistep checks: each step whose URL matches is sent with the certificate, other steps are not. A step whose host is filled in by a variable at run time (for example https://{{host}}/v1) does not get the certificate.
  • The match is on the host name only: any port or path on that host gets it. A subdomain does not: a certificate for partner.com is not sent to api.partner.com.
  • If the API redirects to another host, the certificate is not sent there.

In the API check editor, a note under the URL says when a client certificate will be sent for that host.

Browser checks, TCP, DNS and SSL certificate monitors do not send client certificates.

The list shows each host with the certificate's subject, issuer and expiry date. The private key and passphrase are never shown again after saving.

  • Replace uploads a new certificate for the same host, for example before the old one expires. Checks use the new one within a minute.
  • Delete asks you to confirm, then removes the certificate. Checks to that host then run without one, and an API that requires it refuses the connection.

The team owner receives an email when a client certificate is 30 days, 7 days and 1 day from expiry, and once more when it has expired. Each warning is sent once per certificate. Replacing the certificate starts the warnings again for the new one. In the list, a certificate that expires within 30 days is marked.

  • The certificate, private key, passphrase and CA are stored encrypted in the same vault as your secrets. Only non-secret details (host, subject, issuer, validity dates, fingerprint) are kept in the database, for the list.
  • They are read only when a check runs, and only for that check's host. They are never shown in check results, run previews, logs or the API.
  • When the account that owns the team is deleted, its client certificates are deleted with the rest of the team's data.
  • Professional plan, up to 10 certificates per team, one per host.
  • PEM only. At most 16,000 characters each for the certificate, key and CA, and 24,000 for all of them together with the passphrase. The passphrase itself can be at most 1,024 characters.
  • No wildcard hosts: add each host you call.
  • Checks that send a client certificate do not run from Bahrain (me-south-1) yet. That location is skipped for them. If it was the only location, the check runs from N. Virginia (us-east-1).
  • The check fails with a connection reset or a TLS error right after connecting. The server refused the handshake. Check that the certificate is the one the API provider issued for you, that it has not been revoked, and that the host in the list is exactly the host in the check URL.
  • The check fails with a certificate error about the server. The API's own certificate is signed by a private CA: add that CA as the Server CA certificate.
  • "The private key does not belong to this certificate". The key and certificate are from different pairs. Ask the provider for the matching pair, or check that you did not paste an intermediate certificate first.