mirror of
https://github.com/hibiken/asynqmon.git
synced 2025-01-19 11:15:53 +08:00
Fix getRedisOptionsFromFlags helper
This commit is contained in:
parent
0eb9d88c53
commit
e942c1b0b3
12
main.go
12
main.go
@ -103,20 +103,18 @@ func getRedisOptionsFromFlags() (*redis.Options, error) {
|
|||||||
Addr: flagRedisAddr,
|
Addr: flagRedisAddr,
|
||||||
DB: flagRedisDB,
|
DB: flagRedisDB,
|
||||||
Password: flagRedisPassword,
|
Password: flagRedisPassword,
|
||||||
TLSConfig: &tls.Config{},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if tls := opts.TLSConfig; tls != nil {
|
if flagRedisTLS != "" {
|
||||||
if tlsHost := flagRedisTLS; tlsHost != "" {
|
opts.TLSConfig = &tls.Config{ServerName: flagRedisTLS}
|
||||||
tls.ServerName = tlsHost
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if flagRedisInsecureTLS {
|
if flagRedisInsecureTLS {
|
||||||
tls.InsecureSkipVerify = true
|
if opts.TLSConfig == nil {
|
||||||
|
opts.TLSConfig = &tls.Config{}
|
||||||
}
|
}
|
||||||
|
opts.TLSConfig.InsecureSkipVerify = true
|
||||||
}
|
}
|
||||||
|
|
||||||
return opts, nil
|
return opts, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user