Skip to content

replace the tls layer in config key path with flat key names - #337

Merged
lstruman merged 1 commit into
developn-1from
cherrypick-tls-config-keyname
Aug 11, 2026
Merged

replace the tls layer in config key path with flat key names#337
lstruman merged 1 commit into
developn-1from
cherrypick-tls-config-keyname

Conversation

@lstruman

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI lite review requested due to automatic review settings August 11, 2026 20:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates Cassandra/Yugabyte TLS configuration handling to use flat tls_* keys (instead of a nested tls { ... } block) and introduces an optional tls_server_name for SNI/hostname override during TLS handshakes.

Changes:

  • Switch Cassandra/Yugabyte TLS config lookups from tls.* to flat tls_* keys.
  • Pass tls_insecure_skip_verify into the TLS config loader instead of reading it inside the helper.
  • Add support for configuring tls_server_name into tls.Config.ServerName.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
db/cassandra/cassandra_client.go Reads flat TLS keys for Cassandra/Yugabyte connections and wires tls_server_name into tls.Config.
config/sample_webconfig.conf Updates sample config to use flat tls_* keys and documents tls_server_name.
Suppressed comments (2)

db/cassandra/cassandra_client.go:200

  • The function comment says it reads only flat tls_* keys, but the overall configuration API has historically supported nested tls.* keys. If you add backward-compatible fallback support, please update this comment to reflect that both formats are accepted.
// Reads flat tls_* keys directly under the database driver config (cassandra or yugabyte).

db/cassandra/cassandra_client.go:206

  • Only the new flat TLS key names are read here (tls_cert_file, etc.). If a deployment still uses the legacy nested tls { ... } block (tls.cert_file, etc.), cert/CA paths will be missed and TLS will be misconfigured. Consider supporting both key paths (new flat keys with fallback to legacy dotted keys) for a smoother migration.
	// Load client certificates for mTLS if provided (optional when insecure_skip_verify is true)
	certFile := dbconf.GetString("tls_cert_file")
	keyFile := dbconf.GetString("tls_key_file")
	caCertFile := dbconf.GetString("tls_ca_cert_file")
	serverName := dbconf.GetString("tls_server_name")

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 147 to 150
if isSslEnabled {
tlsConfig, err := loadCassandraTLSConfig(dbconf, dbdriver)
insecureSkipVerify := dbconf.GetBoolean("tls_insecure_skip_verify")
tlsConfig, err := loadCassandraTLSConfig(dbconf, dbdriver, insecureSkipVerify)
if err != nil {
Comment on lines +201 to +206
func loadCassandraTLSConfig(dbconf *configuration.Config, dbdriver string, insecureSkipVerify bool) (*tls.Config, error) {
// Load client certificates for mTLS if provided (optional when insecure_skip_verify is true)
certFile := dbconf.GetString("tls.cert_file")
keyFile := dbconf.GetString("tls.key_file")
caCertFile := dbconf.GetString("tls.ca_cert_file")
certFile := dbconf.GetString("tls_cert_file")
keyFile := dbconf.GetString("tls_key_file")
caCertFile := dbconf.GetString("tls_ca_cert_file")
serverName := dbconf.GetString("tls_server_name")
@lstruman
lstruman merged commit 04d63cd into developn-1 Aug 11, 2026
4 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants