TLS (Transport Layer Security) provides a secure communication channel between Kong Gateway and PostgreSQL. When configured correctly, TLS ensures encrypted traffic, verifies authenticity, and helps maintain data integrity.
Mutual TLS (mTLS) enhances this by requiring both the client Kong Gateway and the PostgreSQL server to authenticate each other. This approach further reduces the risk of unauthorized access by validating the identities at both ends of the connection.
Using TLS and mTLS for database communication introduces benefits such as:
- Encryption: Protects data in transit from being intercepted.
- Authentication: Verifies both the server and client identities.
- Integrity: Prevents tampering during transmission.
However, enabling TLS or mTLS does add operational complexity. Proper configuration requires valid certificates, matching protocol versions, and secure file permissions.
Kong Gateway supports TLS and mTLS when connecting to PostgreSQL and provides configuration options to control verification depth, trusted certificate authorities, and client certificate authentication.
PostgreSQL must be compiled or installed with TLS support. In mTLS setups, the server must also validate client certificates, typically by matching certificate metadata with database access rules.