mirror of
https://github.com/redis/go-redis.git
synced 2025-07-28 06:42:00 +03:00
feat(options): add skip_verify param (#3216)
* feat(options): Add skip_verify param When parsing a URL, add a "skip_verify" query param to disable TLS certificate verification. Inspired by various Go drivers: * ClickHouse: https://github.com/ClickHouse/clickhouse-go/blob/v2.30.0/clickhouse_options.go#L259 * MongoDB: https://github.com/mongodb/mongo-go-driver/blob/v2.0.0/x/mongo/driver/connstring/connstring.go#L609 * MySQL: https://github.com/go-sql-driver/mysql/blob/v1.8.1/dsn.go#L175 Signed-off-by: Julien Riou <julien@riou.xyz> * docs(options): Add skip_verify to ParseURL Signed-off-by: Julien Riou <julien@riou.xyz> --------- Signed-off-by: Julien Riou <julien@riou.xyz> Co-authored-by: Nedyalko Dyakov <nedyalko.dyakov@gmail.com>
This commit is contained in:
@ -30,6 +30,9 @@ func TestParseURL(t *testing.T) {
|
||||
}, {
|
||||
url: "rediss://localhost:123",
|
||||
o: &Options{Addr: "localhost:123", TLSConfig: &tls.Config{ /* no deep comparison */ }},
|
||||
}, {
|
||||
url: "rediss://localhost:123/?skip_verify=true",
|
||||
o: &Options{Addr: "localhost:123", TLSConfig: &tls.Config{InsecureSkipVerify: true}},
|
||||
}, {
|
||||
url: "redis://:bar@localhost:123",
|
||||
o: &Options{Addr: "localhost:123", Password: "bar"},
|
||||
|
Reference in New Issue
Block a user