Skip to content

Commit

Permalink
Move TLS Loading Inside Insecure Check
Browse files Browse the repository at this point in the history
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
  • Loading branch information
mahadzaryab1 committed Sep 26, 2024
1 parent 5c03cb9 commit 9c705d1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/cassandra/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,11 @@ func (c *Configuration) NewCluster() (*gocql.ClusterConfig, error) {
AllowedAuthenticators: c.Connection.Authenticator.Basic.AllowedAuthenticators,
}
}
tlsCfg, err := c.Connection.TLS.LoadTLSConfig(context.Background())
if err != nil {
return nil, err
}
if !c.Connection.TLS.Insecure {
tlsCfg, err := c.Connection.TLS.LoadTLSConfig(context.Background())
if err != nil {
return nil, err

Check warning on line 195 in pkg/cassandra/config/config.go

View check run for this annotation

Codecov / codecov/patch

pkg/cassandra/config/config.go#L193-L195

Added lines #L193 - L195 were not covered by tests
}
cluster.SslOpts = &gocql.SslOptions{
Config: tlsCfg,
}
Expand Down

0 comments on commit 9c705d1

Please sign in to comment.