mirror of
https://github.com/hashicorp/vault.git
synced 2025-11-14 07:11:11 +01:00
mongodb secret backend: Parse ssl URI option as a boolean rather than relying on string comparison
This commit is contained in:
parent
339aec9751
commit
c8cbd33f74
@ -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…
x
Reference in New Issue
Block a user