From a9ccba716aca4a01c6b428d5cb00c4e17c8596ab Mon Sep 17 00:00:00 2001 From: geemus Date: Tue, 16 Jul 2024 16:29:32 +0000 Subject: [PATCH] only error on eab if one or the other is missing, not both --- lib/puma/acme/plugin.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/puma/acme/plugin.rb b/lib/puma/acme/plugin.rb index fc5c8e3..94827b7 100644 --- a/lib/puma/acme/plugin.rb +++ b/lib/puma/acme/plugin.rb @@ -16,9 +16,9 @@ def start(launcher) tos_agreed = launcher.options.fetch(:acme_tos_agreed, false) eab_kid = launcher.options[:acme_eab_kid] - raise(Error, 'missing ACME_KID') if !eab_kid || eab_kid.empty? eab_hmac_key = launcher.options[:acme_eab_hmac_key] - raise(Error, 'missing ACME_HMAC_KEY') if !eab_hmac_key || eab_hmac_key.empty? + raise(Error, 'missing ACME_KID') if eab_hmac_key && !eab_hmac_key.empty? && (!eab_key || eab_kid.empty?) + raise(Error, 'missing ACME_HMAC_KEY') if eab_kid && !eab_kid.empty? && (!eab_hmac_key || eab_hmac_key.empty?) eab = Eab.new(kid: eab_kid, hmac_key: eab_hmac_key)