Override http timeouts
m42s opened this issue ยท 7 comments
I would like to be able to override the read and connect timeouts.
Is this some you would consider adding?
The current timeouts are hardcoded to 10 seconds, which should be fairly sufficient. Is there a reason why you need more?
While 10 seconds are good default values, I'm actually interested in lowering them.
I process multiple certificates in a sequence and don't want to wait too long if either the network or ACME are slow - I prefer to fail faster and retry.
Moreover, since the timeouts are configured anyway (as they should), I find it desirable to allow developers to decide how to make acme4j fit into their systems, by making the timeouts configurable.
You made a good point. I will add a way to configure the timeouts for the next version.
I have added a way in commit e7c2bf2.
For example, you can now use Session.networkSettings().setTimeout(Duration.ofSeconds(2))
to reduce the network timeout to 2 seconds.
Is this okay for you? Connection and read timeouts could have been changed separately, but I wanted to keep things simple.
I think this solution does what it's supposed to do.
Thank you for taking the time to do it and looking forward for it to be released.
Ok, then I will close this issue.
It is hopefully released very soon. I am still busy with a major addition to the mock module, which took much longer than it was supposed to do. ๐
I have just released V2.8 with that change. Thank you for your patience! ๐