mongodb secret backend: Parse ssl URI option as a boolean rather than relying on string comparison
This commit is contained in:
parent
46bf080409
commit
cdde4071d7
|
@ -55,7 +55,11 @@ func parseMongoURI(rawUri string) (*mgo.DialInfo, error) {
|
|||
}
|
||||
info.PoolLimit = poolLimit
|
||||
case "ssl":
|
||||
if value == "true" {
|
||||
ssl, err := strconv.ParseBool(value)
|
||||
if err != nil {
|
||||
return nil, errors.New("bad value for ssl: " + value)
|
||||
}
|
||||
if ssl {
|
||||
info.DialServer = func(addr *mgo.ServerAddr) (net.Conn, error) {
|
||||
return tls.Dial("tcp", addr.String(), &tls.Config{})
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue