File tree Expand file tree Collapse file tree 2 files changed +20
-9
lines changed Expand file tree Collapse file tree 2 files changed +20
-9
lines changed Original file line number Diff line number Diff line change @@ -62,15 +62,16 @@ type Cassandra struct {
6262}
6363
6464type cassandraMetadata struct {
65- Hosts []string
66- Port int
67- ProtoVersion int
68- ReplicationFactor int
69- Username string
70- Password string
71- Consistency string
72- Table string
73- Keyspace string
65+ Hosts []string
66+ Port int
67+ ProtoVersion int
68+ ReplicationFactor int
69+ Username string
70+ Password string
71+ Consistency string
72+ Table string
73+ Keyspace string
74+ EnableHostVerification bool
7475}
7576
7677// NewCassandraStateStore returns a new cassandra state store.
@@ -136,6 +137,11 @@ func (c *Cassandra) createClusterConfig(metadata *cassandraMetadata) (*gocql.Clu
136137 if metadata .Username != "" && metadata .Password != "" {
137138 clusterConfig .Authenticator = gocql.PasswordAuthenticator {Username : metadata .Username , Password : metadata .Password }
138139 }
140+ if metadata .EnableHostVerification {
141+ clusterConfig .SslOpts = & gocql.SslOptions {
142+ EnableHostVerification : true ,
143+ }
144+ }
139145 clusterConfig .Port = metadata .Port
140146 clusterConfig .ProtoVersion = metadata .ProtoVersion
141147 cons , err := c .getConsistency (metadata .Consistency )
Original file line number Diff line number Diff line change @@ -38,6 +38,11 @@ metadata:
3838 description : " Port for communication."
3939 default : " 9042"
4040 example : " 8080"
41+ - name : enableHostVerification
42+ type : bool
43+ description : " Enables host verification. Secures the traffic between client server with TLS."
44+ default : " false"
45+ example : " true"
4146 - name : table
4247 type : string
4348 description : " The name of the table to use."
You can’t perform that action at this time.
0 commit comments