Adds TLS support to Cassandra State Store (#3230)
Adds TLS support to Cassandra State Store
This commit is contained in:
parent
1f12557241
commit
ba5831b1ce
|
|
@ -71,6 +71,7 @@ type cassandraMetadata struct {
|
|||
Consistency string
|
||||
Table string
|
||||
Keyspace string
|
||||
EnableHostVerification bool
|
||||
}
|
||||
|
||||
// NewCassandraStateStore returns a new cassandra state store.
|
||||
|
|
@ -136,6 +137,11 @@ func (c *Cassandra) createClusterConfig(metadata *cassandraMetadata) (*gocql.Clu
|
|||
if metadata.Username != "" && metadata.Password != "" {
|
||||
clusterConfig.Authenticator = gocql.PasswordAuthenticator{Username: metadata.Username, Password: metadata.Password}
|
||||
}
|
||||
if metadata.EnableHostVerification {
|
||||
clusterConfig.SslOpts = &gocql.SslOptions{
|
||||
EnableHostVerification: true,
|
||||
}
|
||||
}
|
||||
clusterConfig.Port = metadata.Port
|
||||
clusterConfig.ProtoVersion = metadata.ProtoVersion
|
||||
cons, err := c.getConsistency(metadata.Consistency)
|
||||
|
|
|
|||
|
|
@ -38,6 +38,11 @@ metadata:
|
|||
description: "Port for communication."
|
||||
default: "9042"
|
||||
example: "8080"
|
||||
- name: enableHostVerification
|
||||
type: bool
|
||||
description: "Enables host verification. Secures the traffic between client server with TLS."
|
||||
default: "false"
|
||||
example: "true"
|
||||
- name: table
|
||||
type: string
|
||||
description: "The name of the table to use."
|
||||
|
|
|
|||
Loading…
Reference in New Issue