@startuml
:MQTT service starts;
start
if (certificate expired) then
#pink:raise error;
kill
endif
:start accepting connections;
:check certificate;
if (expiring soon) then (yes)
:generate new certificate;
:send to clients;
if (confirmation NOK) then
#pink:raise error;
kill
endif
:restart MQTT;
else (no)
:continue;
endif
stop
@enduml