Skip to content

NewFailoverClient seems to not support TLS #1732

@mdouchement

Description

@mdouchement

NewFailoverClient seems to not support TLS, a tcpdump shows plaintext auth.

Expected Behavior

It should PING the Redis server.

Current Behavior

$ go run .
redis: 2021/04/20 10:11:24 sentinel.go:682: sentinel: discovered new sentinel="r1.example.org:26379" for master="master"
redis: 2021/04/20 10:11:24 sentinel.go:643: sentinel: new master="master" addr="r0.example.org:6379"
panic: read: connection reset by peer

Steps to Reproduce

package main

import (
	"context"
	"crypto/tls"
	"fmt"
	"time"

	"github.com/go-redis/redis/v8"
)

func main() {
	rdb := redis.NewFailoverClient(&redis.FailoverOptions{
		MasterName: "master",
		SentinelAddrs: []string{
			"r0.example.org:26379",
			"r1.example.org:26379",
		},
		SentinelPassword: "strongpassword",
		Password:         "strongpassword",
		TLSConfig:        &tls.Config{},
		DB:               1,
	})

	err := rdb.Ping(context.Background()).Err()
	if err != nil {
		panic(err)
	}
}

Context (Environment)

  • github.com/go-redis/redis/v8 v8.8.2
  • redis_version:6.2.1

Detailed Description

Possible Implementation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions