use_mutual_tls_auth
to true
, and client_certificates
as an array of strings - certificate IDs.
From the Tyk Dashboard, to do the same from the API Designer Core settings section you need to select Mutual TLS authentication mode from the Authentication section, and allow the certificates using the built-in widget, as below:
security.certificates.apis
key - string array of certificate IDs or paths.
Select Strip Authorization Data to strip any authorization data from your API requests.
Be aware that mutual TLS authorization has special treatment because it is not “authentication” and does not provide any identifying functionality, like keys, so you need to mix it with another authentication modes options like Auth Key or Keyless. On the dashboard, you need to choose Use multiple auth mechanism in the Authentication mode drop-down, where you should select Mutual TLS and another option which suits your use-case.
Use Case | Static | Dynamic |
---|---|---|
Let developers upload their own public certificates through the Developer Portal | ❌ | ✅ |
Combine client mTLS with another authentication method | ✅ | ✅ |
Allow certs at the API level (one or more APIs per cert) | ✅ | ❌ |
Allow certs at an individual level (one or more APIs per cert) | ❌ | ✅ |
httpbin-client-mtls
.
client_certificate_refs
field references the Kubernetes secret created in the previous step.
TykOasApiDefinition
CRD. You can reference Kubernetes secrets that store client certificates in your API definitions.
Example of Referencing Client Certificates in Tyk OAS
In this example, the clientCertificate
section allows you to enable client certificate management and specify a list of Kubernetes secrets (tls-cert
) that store allowed client certificates.
auth.use_certificate
set to true
.