SNIs

Uses: Kong Gateway Admin API decK KIC Konnect API Terraform

What is an SNI?

An SNI (Server Name Indication) is used to map multiple hostnames to a Certificate. It allows Kong Gateway to select which SSL/TLS Certificate to use based on the hostname in the client request. This feature ensures that multiple domains can be securely served through the same gateway.

SNI routing

When configuring a Route with a secure protocol, like HTTPS, gRPC, or TLS, you can use an SNI for routing. The SNI is determined during the TLS handshake process and will remain unchanged for the duration of the connection, so all requests will contain the same SNI regardless of the defined Header in the Route configuration. For more information on how routing priorities are assigned read the Expressions Router documentation.

Wildcards

Valid wildcard positions for configuring SNIs are:

  • mydomain.*
  • *.mydomain.com
  • *.www.mydomain.com

This is especially useful when configuring TLS Routes.

Prioritization matching

The prioritization for matching SNIs to Certificates follows this order:

  1. Exact SNI matching certificate
  2. Search for a certificate by an SNI prefix wildcard
  3. Search for a certificate by an SNI suffix wildcard
  4. Search for a certificate associated with the SNI *
  5. The default certificate on the file system

Schema

Set up an SNI

Something wrong?

Help us make these docs great!

Kong Developer docs are open source. If you find these useful and want to make them better, contribute today!