From e1c4f8a2a9288e6a1f09732e09e157e626f8ab8a Mon Sep 17 00:00:00 2001 From: Marcel Baumgartner <68913099+Marcel-Baumgartner@users.noreply.github.com> Date: Fri, 13 Oct 2023 23:02:23 +0200 Subject: [PATCH] Added additional logs for lets encrypt certificates --- Moonlight/App/Services/LetsEncryptService.cs | 37 ++++++++++++-------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/Moonlight/App/Services/LetsEncryptService.cs b/Moonlight/App/Services/LetsEncryptService.cs index c9b684cc..70e82e78 100644 --- a/Moonlight/App/Services/LetsEncryptService.cs +++ b/Moonlight/App/Services/LetsEncryptService.cs @@ -27,25 +27,33 @@ public class LetsEncryptService public async Task AutoProcess() { - if (!ConfigService.Get().Moonlight.LetsEncrypt.Enable) + try + { + if (!ConfigService.Get().Moonlight.LetsEncrypt.Enable) return; - if (await CheckNeedsRenewal()) - { - try + if (await CheckNeedsRenewal()) { - await Renew(); + try + { + await Renew(); + } + catch (Exception e) + { + Logger.Error("Unable to issue lets encrypt certificate"); + Logger.Error(e); + } } - catch (Exception e) - { - Logger.Error("Unable to issue lets encrypt certificate"); - Logger.Error(e); - } - } - else - Logger.Info("Skipping lets encrypt renewal"); + else + Logger.Info("Skipping lets encrypt renewal"); - await LoadCertificate(); + await LoadCertificate(); + } + catch(Exception e) + { + Logger.Error("Unhandled exception while auto proccessing lets encrypt certificates"); + Logger.Error(e); + } } private Task LoadCertificate() @@ -105,6 +113,7 @@ public class LetsEncryptService try { await challenge.Validate(); + Logger.Info("Tried to validate"); } catch (Exception e) {