diff --git a/builtin/logical/cassandra/backend.go b/builtin/logical/cassandra/backend.go
index efbb46c07..755082c08 100644
--- a/builtin/logical/cassandra/backend.go
+++ b/builtin/logical/cassandra/backend.go
@@ -21,12 +21,6 @@ func Backend() *framework.Backend {
b.Backend = &framework.Backend{
Help: strings.TrimSpace(backendHelp),
- PathsSpecial: &logical.Paths{
- Root: []string{
- "config/*",
- },
- },
-
Paths: []*framework.Path{
pathConfigConnection(&b),
pathRoles(&b),
@@ -52,14 +46,15 @@ type backend struct {
}
type sessionConfig struct {
- Hosts string `json:"hosts" structs:"hosts"`
- Username string `json:"username" structs:"username"`
- Password string `json:"password" structs:"password"`
- TLS bool `json:"tls" structs:"tls"`
- InsecureTLS bool `json:"insecure_tls" structs:"insecure_tls"`
- Certificate string `json:"certificate" structs:"certificate"`
- PrivateKey string `json:"private_key" structs:"private_key"`
- IssuingCA string `json:"issuing_ca" structs:"issuing_ca"`
+ Hosts string `json:"hosts" structs:"hosts"`
+ Username string `json:"username" structs:"username"`
+ Password string `json:"password" structs:"password"`
+ TLS bool `json:"tls" structs:"tls"`
+ InsecureTLS bool `json:"insecure_tls" structs:"insecure_tls"`
+ Certificate string `json:"certificate" structs:"certificate"`
+ PrivateKey string `json:"private_key" structs:"private_key"`
+ IssuingCA string `json:"issuing_ca" structs:"issuing_ca"`
+ ProtocolVersion int `json:"protocol_version" structs:"protocol_version"`
}
// DB returns the database connection.
diff --git a/builtin/logical/cassandra/path_config_connection.go b/builtin/logical/cassandra/path_config_connection.go
index b4ebd7076..6b34d6bae 100644
--- a/builtin/logical/cassandra/path_config_connection.go
+++ b/builtin/logical/cassandra/path_config_connection.go
@@ -55,10 +55,15 @@ backend can be directly passed into this parameter.
If both this and "pem_bundle" are specified, this will
take precedence.`,
},
+
+ "protocol_version": &framework.FieldSchema{
+ Type: framework.TypeInt,
+ Description: `The protocol version to use. Defaults to 2.`,
+ },
},
Callbacks: map[logical.Operation]framework.OperationFunc{
- logical.ReadOperation: b.pathConnectionRead,
+ logical.ReadOperation: b.pathConnectionRead,
logical.UpdateOperation: b.pathConnectionWrite,
},
@@ -108,11 +113,12 @@ func (b *backend) pathConnectionWrite(
}
config := &sessionConfig{
- Hosts: hosts,
- Username: username,
- Password: password,
- TLS: data.Get("tls").(bool),
- InsecureTLS: data.Get("insecure_tls").(bool),
+ Hosts: hosts,
+ Username: username,
+ Password: password,
+ TLS: data.Get("tls").(bool),
+ InsecureTLS: data.Get("insecure_tls").(bool),
+ ProtocolVersion: data.Get("protocol_version").(int),
}
if config.InsecureTLS {
diff --git a/builtin/logical/cassandra/util.go b/builtin/logical/cassandra/util.go
index 394bfafd5..193de6661 100644
--- a/builtin/logical/cassandra/util.go
+++ b/builtin/logical/cassandra/util.go
@@ -39,6 +39,11 @@ func createSession(cfg *sessionConfig, s logical.Storage) (*gocql.Session, error
Password: cfg.Password,
}
+ clusterConfig.ProtoVersion = cfg.ProtocolVersion
+ if clusterConfig.ProtoVersion == 0 {
+ clusterConfig.ProtoVersion = 2
+ }
+
if cfg.TLS {
tlsConfig := &tls.Config{
InsecureSkipVerify: cfg.InsecureTLS,
diff --git a/website/source/docs/secrets/cassandra/index.html.md b/website/source/docs/secrets/cassandra/index.html.md
index a638d8bd8..8d0f903b4 100644
--- a/website/source/docs/secrets/cassandra/index.html.md
+++ b/website/source/docs/secrets/cassandra/index.html.md
@@ -104,20 +104,28 @@ subpath for interactive help output.
TLS works as follows: