Skip to content

Commit

Permalink
only error on eab if one or the other is missing, not both
Browse files Browse the repository at this point in the history
  • Loading branch information
geemus committed Jul 16, 2024
1 parent 1f183b6 commit a9ccba7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/puma/acme/plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit a9ccba7

Please sign in to comment.