vcert enroll does not enforce timeout flag
PROBLEM SUMMARY
vcert enroll does not enforce timeout flag. No matter what value you enter it always use 180 (3 minutes) timeout
commands.go have this error on line 356 req.Timeout = time.Duration(180) * time.Second should be req.Timeout = time.Duration(flags.timeout) * time.Second
confirmed working on local make build
STEPS TO REPRODUCE
vcert enroll --timeout 300
EXPECTED RESULTS
It should enforce timeout flag
ACTUAL RESULTS
not enforcing flag
ENVIRONMENT DETAILS
linux using vcert latest version but it may happen on other OS flavours as the error is within the main command code
COMMENTS/WORKAROUNDS
I apologize in advance for not doing a fork and submit a merge myself.
Hi @dx0xm , thank you for reaching out.
The timeout flag is provided during enrollment for both TLS and SSH certificates here https://github.com/Venafi/vcert/blob/master/cmd/vcert/commands.go#L357 and here https://github.com/Venafi/vcert/blob/master/cmd/vcert/commands.go#L500 , respectively. Not sure if there is some other place where you expected that flag to take effect.
Hi @luispresuelVenafi , the flag is provided but not working for tls certificates.
This line: https://github.com/Venafi/vcert/blob/master/cmd/vcert/commands.go#L357 does not work because the flag is not used in here: https://github.com/Venafi/vcert/blob/master/cmd/vcert/commands.go#L356
It always uses the default 3m timeout. I can confirm it can be fixed if your replace https://github.com/Venafi/vcert/blob/master/cmd/vcert/commands.go#L356 with req.Timeout = time.Duration(flags.timeout) * time.Second