File tree 2 files changed +20
-2
lines changed
2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -245,7 +245,7 @@ func getRedisTLSOptions(uri *url.URL) *tls.Config {
245
245
246
246
if len (skipverify ) > 0 {
247
247
skipverify , err := strconv .ParseBool (skipverify )
248
- if err ! = nil {
248
+ if err = = nil {
249
249
tlsConfig .InsecureSkipVerify = skipverify
250
250
}
251
251
}
@@ -254,7 +254,7 @@ func getRedisTLSOptions(uri *url.URL) *tls.Config {
254
254
255
255
if len (insecureskipverify ) > 0 {
256
256
insecureskipverify , err := strconv .ParseBool (insecureskipverify )
257
- if err ! = nil {
257
+ if err = = nil {
258
258
tlsConfig .InsecureSkipVerify = insecureskipverify
259
259
}
260
260
}
Original file line number Diff line number Diff line change @@ -27,6 +27,24 @@ func TestRedisPasswordOpt(t *testing.T) {
27
27
}
28
28
}
29
29
30
+ func TestSkipVerifyOpt (t * testing.T ) {
31
+ uri , _ := url .Parse ("rediss://myredis/0?skipverify=true" )
32
+ tlsConfig := getRedisTLSOptions (uri )
33
+
34
+ if ! tlsConfig .InsecureSkipVerify {
35
+ t .Fail ()
36
+ }
37
+ }
38
+
39
+ func TestInsecureSkipVerifyOpt (t * testing.T ) {
40
+ uri , _ := url .Parse ("rediss://myredis/0?insecureskipverify=true" )
41
+ tlsConfig := getRedisTLSOptions (uri )
42
+
43
+ if ! tlsConfig .InsecureSkipVerify {
44
+ t .Fail ()
45
+ }
46
+ }
47
+
30
48
func TestRedisSentinelUsernameOpt (t * testing.T ) {
31
49
uri , _ := url .Parse ("redis+sentinel://redis:password@myredis/0?sentinelusername=suser&sentinelpassword=spass" )
32
50
opts := getRedisOptions (uri ).Failover ()
You can’t perform that action at this time.
0 commit comments