I've got a gateway stateless service which serves as an entry point to my service fabric cluster. It's secured using let's encrypt SSL certificate. It is set using the service start up like below
return new WebHostBuilder()
.UseKestrel(opt =>
{
int port = serviceContext.CodePackageActivationContext.GetEndpoint("ServiceEndpoint")
.Port;
opt.Listen(IPAddress.IPv6Any, port, listenOptions =>
{
listenOptions.UseHttps(GetCertificateFromStore());
listenOptions.NoDelay = true;
});
})
Now I would like to automatically renew such certificate. I've got re-fetch logic in place and I can replace it in the key vault easily. However, I have no idea how to replace it in the running application. Especially, that service fabric seems not to have any mechanism to 'restart' a service. I'd be grateful for an suggestions.