mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
[fixed] tls timeout now accepts units
Signed-off-by: Matthias Hanel <mh@synadia.com>
This commit is contained in:
@@ -5,7 +5,7 @@ listen: 127.0.0.1:4443
|
||||
tls {
|
||||
cert_file: "./configs/certs/server.pem"
|
||||
key_file: "./configs/certs/key.pem"
|
||||
timeout: 2
|
||||
timeout: "2s"
|
||||
}
|
||||
|
||||
authorization {
|
||||
|
||||
@@ -3552,6 +3552,14 @@ func parseTLS(v interface{}, isClientCtx bool) (t *TLSConfigOpts, retErr error)
|
||||
at = float64(mv)
|
||||
case float64:
|
||||
at = mv
|
||||
case string:
|
||||
d, err := time.ParseDuration(mv)
|
||||
if err != nil {
|
||||
return nil, &configErr{tk, fmt.Sprintf("error parsing tls config, 'timeout' %s", err)}
|
||||
}
|
||||
at = d.Seconds()
|
||||
default:
|
||||
return nil, &configErr{tk, "error parsing tls config, 'timeout' wrong type"}
|
||||
}
|
||||
tc.Timeout = at
|
||||
case "pinned_certs":
|
||||
|
||||
Reference in New Issue
Block a user