@Paul-Reed if you read the last couple of posts you'll see this hasn't been resolved yet.
Here's my proposal for how to support the cert renewal. Note this is primarily about the externals of the design - how it would get used. I'm less concern at this stage about individual lines of code in the internal implementation - we can save that for discussion in the PR.
-
https
can be the object it is today and everything works as it does today. - Alternatively,
https
can be a Function that when called, returns the object (or a Promise.. see below) with the appropriate values. -
httpsRefreshInterval
is a new property to determine how often it will refresh the https configuration.
Furthermore...
- if
https
is a static object andhttpsRefreshInterval
is set, we should log a warning that is an invalid configuration, but it should not be fatal. - if
httpsRefreshInterval
is set and we are running in a version of Node that doesn't support changing the secure context, we should log a warning. - if
https
is a function, it should be able to return either the Object itself, or a Promise that resolves to the object. This will allow the function to perform asynchronous actions, such as re-reading files etc.
Any changes need to go into the dev
branch for the 1.1.0 release.