diff options
Diffstat (limited to '')
-rw-r--r-- | tcpiohandler.hh | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/tcpiohandler.hh b/tcpiohandler.hh index 058d104..8420529 100644 --- a/tcpiohandler.hh +++ b/tcpiohandler.hh @@ -81,7 +81,6 @@ public: { throw std::runtime_error("This TLS backend does not have the capability to load a tickets key from a file"); } - void handleTicketsKeyRotation(time_t now) { if (d_ticketsKeyRotationDelay != 0 && now > d_ticketsKeyNextRotation) { @@ -124,10 +123,27 @@ public: return false; } + using tickets_key_added_hook = std::function<void(const std::string& key)>; + + static void setTicketsKeyAddedHook(const tickets_key_added_hook& hook) + { + TLSCtx::s_ticketsKeyAddedHook = hook; + } + static const tickets_key_added_hook& getTicketsKeyAddedHook() + { + return TLSCtx::s_ticketsKeyAddedHook; + } + static bool hasTicketsKeyAddedHook() + { + return TLSCtx::s_ticketsKeyAddedHook != nullptr; + } protected: std::atomic_flag d_rotatingTicketsKey; std::atomic<time_t> d_ticketsKeyNextRotation{0}; time_t d_ticketsKeyRotationDelay{0}; + +private: + static tickets_key_added_hook s_ticketsKeyAddedHook; }; class TLSFrontend |