Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 30 additions & 36 deletions config/sample_webconfig.conf
Original file line number Diff line number Diff line change
Expand Up @@ -197,24 +197,21 @@ webconfig {
disable_initial_host_lookup = false

// TLS/SSL configuration (optional when is_ssl_enabled = true)
// If tls block is not provided or incomplete, will use insecure TLS
tls {
// Client certificate for mutual TLS (mTLS) - optional
cert_file = "/path/to/client-cert.pem"
key_file = "/path/to/client-key.pem"

// CA certificate for server verification - optional
ca_cert_file = "/path/to/ca-cert.pem"

// Skip certificate verification (INSECURE - for testing only)
// When true, allows TLS without certificates or CA validation
insecure_skip_verify = false

// Override SNI hostname sent during TLS handshake.
// Required when the certificate uses DNS SANs only (no IP SANs).
// Leave empty to use the host IP address (gocql default).
server_name = ""
}
// Client certificate for mutual TLS (mTLS) - optional
tls_cert_file = "/path/to/client-cert.pem"
tls_key_file = "/path/to/client-key.pem"

// CA certificate for server verification - optional
tls_ca_cert_file = "/path/to/ca-cert.pem"

// Skip certificate verification (INSECURE - for testing only)
// When true, allows TLS without certificates or CA validation
tls_insecure_skip_verify = false

// Override SNI hostname sent during TLS handshake.
// Required when the certificate uses DNS SANs only (no IP SANs).
// Leave empty to use the host IP address (gocql default).
tls_server_name = ""
}

yugabyte {
Expand Down Expand Up @@ -249,24 +246,21 @@ webconfig {
is_ssl_enabled = true

// TLS/SSL configuration (optional when is_ssl_enabled = true)
// If tls block is not provided or incomplete, will use insecure TLS
tls {
// Client certificate for mutual TLS (mTLS) - optional
cert_file = "/path/to/client-cert.pem"
key_file = "/path/to/client-key.pem"

// CA certificate for server verification - optional
ca_cert_file = "/path/to/ca-cert.pem"

// Skip certificate verification (INSECURE - for testing only)
// When true, allows TLS without certificates or CA validation
insecure_skip_verify = false

// Override SNI hostname sent during TLS handshake.
// Required when the certificate uses DNS SANs only (no IP SANs).
// Leave empty to use the host IP address (gocql default).
server_name = ""
}
// Client certificate for mutual TLS (mTLS) - optional
tls_cert_file = "/path/to/client-cert.pem"
tls_key_file = "/path/to/client-key.pem"

// CA certificate for server verification - optional
tls_ca_cert_file = "/path/to/ca-cert.pem"

// Skip certificate verification (INSECURE - for testing only)
// When true, allows TLS without certificates or CA validation
tls_insecure_skip_verify = false

// Override SNI hostname sent during TLS handshake.
// Required when the certificate uses DNS SANs only (no IP SANs).
// Leave empty to use the host IP address (gocql default).
tls_server_name = ""
}
}

Expand Down
12 changes: 6 additions & 6 deletions db/cassandra/cassandra_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ func NewCassandraClient(conf *configuration.Config, testOnly bool) (*CassandraCl
}

if isSslEnabled {
insecureSkipVerify := dbconf.GetBoolean("tls.insecure_skip_verify")
insecureSkipVerify := dbconf.GetBoolean("tls_insecure_skip_verify")
tlsConfig, err := loadCassandraTLSConfig(dbconf, dbdriver, insecureSkipVerify)
if err != nil {
return nil, common.NewError(err)
Expand Down Expand Up @@ -215,13 +215,13 @@ func NewCassandraClient(conf *configuration.Config, testOnly bool) (*CassandraCl

// loadCassandraTLSConfig loads TLS configuration for Cassandra connection.
// Returns a tls.Config with certificates loaded from the configuration.
// The function expects tls.{} block under the database driver config (cassandra or yugabyte).
// Reads flat tls_* keys directly under the database driver config (cassandra or yugabyte).
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")
serverName := dbconf.GetString("tls.server_name")
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")

// Create TLS config for Cassandra connection.
// Prefer modern ECDHE+AEAD suites for forward secrecy; keep TLS_RSA_WITH_AES_128_CBC_SHA
Expand Down
Loading