Skip to content

Commit

Permalink
Don't send password over insecure connection.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnbywater committed Nov 15, 2023
1 parent f0374cd commit 13bec3a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion esdb/endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func newGrpcClient(config Configuration) *grpcClient {

// Maybe construct RPC credentials from client config.
var perRPCCredentials credentials.PerRPCCredentials
if config.Username != "" && config.Password != "" {
if config.Username != "" && config.Password != "" && !config.DisableTLS {
perRPCCredentials = newBasicAuthPerRPCCredentials(config.Username, config.Password)
}

Expand Down
2 changes: 1 addition & 1 deletion esdb/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func configureGrpcCall(ctx context.Context, conf *Configuration, options options
newCtx, cancel := context.WithDeadline(ctx, deadline)

// Maybe use RPC credentials from client method options instead of RPC credentials from client config.
if options.credentials() != nil {
if options.credentials() != nil && !conf.DisableTLS {
perRPCCredentials = newBasicAuthPerRPCCredentials(options.credentials().Login, options.credentials().Password)
}

Expand Down

0 comments on commit 13bec3a

Please sign in to comment.