TLS
Each listener can terminate TLS for its clients. Configuration is consistent across Postgres and MongoDB modes. ✓ TestListenerConfig_EffectivePostgresTLSMode_Default internal/config/config_test.go:339 ✓ TestListenerConfig_EffectivePostgresTLSMode_CaseInsensitive internal/config/config_test.go:346
[[listeners]]name = "pg-main"mode = "postgres"tls_mode = "optional" # off | optional | requireuse_tailscale_tls = true# cert_file = "/etc/waypoint/server.crt"# key_file = "/etc/waypoint/server.key"tls_mode
Section titled “tls_mode”| Value | Behavior |
|---|---|
off | Reject TLS upgrade requests; serve plaintext only. |
optional | Upgrade to TLS when the client requests it ✓ TestReadStartupMessage_TLSOptionalAcceptsSSL internal/pgwire/startup_test.go:197 ; otherwise plaintext ✓ TestReadStartupMessage_TLSOptionalAllowsPlaintext internal/pgwire/startup_test.go:264 . Default. |
require | Reject plaintext connections. Postgres clients must send SSLRequest ✓ TestReadStartupMessage_TLSRequireRejectsPlaintext internal/pgwire/startup_test.go:247 ✓ TestIntegration_Proxy_TLSRequiredRejectsPlaintext internal/proxy/proxy_integration_test.go:385 ; MongoDB clients must connect over TLS. ✓ TestMongoAcceptClientTLSRequireCapturesSNI internal/proxy/mongodb_tls_test.go:19 |
For Postgres, optional matches the historical default: if the client opens with SSLRequest, Waypoint upgrades; otherwise it proceeds in cleartext.
Certificate sources
Section titled “Certificate sources”Waypoint picks a certificate by server name, in this order:
cert_file/key_file— admin-provided cert, used when the SNI matches ✓TestBuildPostgresClientTLSConfig_UsesAdminCertForMatchingSNIinternal/server/server_test.go:26 (or when no SNI is sent and a file cert is configured ✓TestBuildPostgresClientTLSConfig_NoSNIFallsBackToAdminCertinternal/server/server_test.go:65 ). Use this for custom domains likewaypoint.redo.run.- Tailscale-managed cert — fetched via the Tailscale local API for
*.ts.netnames, whenuse_tailscale_tls = true✓TestListenerConfig_EffectiveUseTailscaleTLS_Defaultinternal/config/config_test.go:353 and HTTPS certificates are enabled in the tailnet. Used when the SNI is a non-admin name ✓TestBuildPostgresClientTLSConfig_UsesTailscaleCertForDifferentSNIinternal/server/server_test.go:46 or unknown. ✓TestBuildPostgresClientTLSConfig_UnknownSNIFallsBackToTailscaleinternal/server/server_test.go:98
Setting use_tailscale_tls = false disables the second source — useful when you want to be sure clients only ever see your file-based cert. ✓ TestBuildPostgresClientTLSConfig_AdminOnlyIgnoresTailscale internal/server/server_test.go:85 ✓ TestListenerConfig_EffectiveUseTailscaleTLS_False internal/config/config_test.go:360
Backend TLS (MongoDB)
Section titled “Backend TLS (MongoDB)”For MongoDB listeners, tls = true enables TLS from Waypoint to each backend member. This is independent of tls_mode (which governs the client side):
[[listeners]]mode = "mongodb"tls = true # Waypoint → MongoDBtls_mode = "require" # client → WaypointWhen clients connect over TLS with SNI, Waypoint rewrites the hostnames in MongoDB topology responses (isMaster, hello) to the SNI hostname, while preserving the advertised listener/member ports. ✓ TestMongoTopologySNIRewritesAdvertiseHostAndPreservesPorts internal/proxy/mongodb_tls_test.go:131 This keeps drivers pinned to the proxy and prevents direct connections to backend members.