In cryptography, a public key certificate, also known as a digital certificate or identity certificate, is an electronic document used to prove the ownership of a public key. The certificate includes information about the key, information about the identity of its owner (called the subject), and the digital signature of an entity that has verified the certificate’s contents (called the issuer). If the signature is valid, and the software examining the certificate trusts the issuer, then it can use that key to communicate securely with the certificate’s subject.When it comes to authorization, it is enough for the server that has a public client certificate in its trusted certificate storage to trust it. However, if you need to send a request to the server protected by mutual TLS, or need to configure the TLS server itself, you also need to have a private key, used while generating the certificate, to sign the request. Using Tyk, you have two main certificate use cases:
openssl
command to generate certificates, it should use PEM by default. A nice bonus of the PEM format is that it allows having multiple entries inside the same file. So in cases where a certificate also requires a private key, you can just concatenate the two files together.
tyk.conf
and tyk_analytics.conf
files.
For self signed certificates additional consideration has to be taken place, refer to the section below.
true
so that your Dashboard URL starts with HTTPS.
If you are using self-signed certs or are in a test environment, you can tell Tyk to ignore validation on certs Mutual TLS support
security.private_certificate_encoding_secret
in the MDCB configuration file to the same value as specified in your management Gateway configuration file. By knowing the original secret, MDCB will be able to decode private keys, and
send them to client without password. Using a secure connection between Data Plane Gateways and MDCB is required in this case. See MDCB setup page for use_ssl usage.
http_server_options
section of your Gateway and Dashboard configuration files. This has the following structure, common to both components:
min_version
and max_version
are optional and allow you to configure the versions of TLS from which Tyk will accept connectionsssl_ciphers
allows you to select the cipher suite that will be used to negotiate connectionsmin_version
and max_version
. The numbers associated with the TLS versions represent protocol version numbers used in the TLS protocol specification. These are standardized numerical values assigned by the Internet Engineering Task Force (IETF) to identify each TLS version during communication.
TLS Version | Value to Use |
---|---|
1.0 (see note) | 769 |
1.1 (see note) | 770 |
1.2 | 771 |
1.3 | 772 |
http_server_options
config option ssl_ciphers
in tyk.conf
and tyk-analytics.conf
. This takes an array of strings as its value. Each string must be one of the allowed cipher suites as defined at https://golang.org/pkg/crypto/tls/#pkg-constants
For example:
tyk.conf
and at the API level.
ssl_force_common_name_check
to true
in your tyk.conf
file.certificates
field, Gateway will dynamically load this ceritficate for your custom domain, so you will not need to restart the process. You can do it from the Dashboard UI too, in the custom domain section.
my-test-tls
in the same namespace as this ApiDefinition resource httpbin
. You can provide the domain certificate in certificate_secret_names
field. Tyk Operator will help you retrieve the certificate from secret and upload it to Tyk.POST /tyk/certs
with PEM body. Returns {"id": "<cert-id>", ... }
DELETE /tyk/certs/<cert-id>
GET /tyk/certs/<cert-id>
. Returns meta info about the certificate, something similar to:GET /tyk/certs/<cert-id1>,<cert-id2>,<cert-id3>
.
Returns array of meta info objects, similar to above.GET /tyk/certs
. Returns something similar to:/api
instead of /tyk
, e.g. /api/certs
, /api/certs/<cert-id>
, etc.security.private_certificate_encoding_secret
secret, defined in tyk.conf
file. Otherwise, the certificate will use the secret value in tyk.conf
.
tyk.conf
:TYK_GW_HTTPSERVEROPTIONS_SSLCERTIFICATES=<cert-id>
(if you want to set multiple certificates just separate them using a comma.)DNSNames
.
Subject.CommonName
field./etc/ssl/certs
For example, if you are using a self-signed cert on the Dashboard, in order for the Gateway to trust it, add it to the Gateway’s certificate store in /etc/ssl/certs
Alternatively, you can disable the verification of SSL certs in the component configurations below. You shouln’t do this in production!
common name
specify a domain, or just pass -subj "/CN=localhost"
to OpenSSL command. Then follow our TLS and SSL Guide.
To get certificate SHA256 fingerprint use the following command:
http_server_options.ssl_insecure_skip_verify
to true
in your tyk.conf to allow the use of self-signed certificates when connecting to the Gateway.
http_server_options.ssl_insecure_skip_verify
to true
in your tyk_analytics.conf to allow the use of self-signed certificates when connecting to the Dashboard.