From 0c670ddfc0a745bd9391da7f03988321735015fa Mon Sep 17 00:00:00 2001 From: Tobias Oetiker Date: Wed, 12 Aug 2020 09:42:25 +0200 Subject: [PATCH] fix challenge management --- CHANGES | 5 ++++- VERSION | 2 +- bin/acmefetch | 24 +++++++++++++++--------- configure | 20 ++++++++++---------- man/acmefetch.1 | 2 +- 5 files changed, 31 insertions(+), 22 deletions(-) diff --git a/CHANGES b/CHANGES index 46d4f0e..23b4cb9 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,7 @@ -2020-07-28 11:27:08 +0200 (HEAD -> v0.7.2, origin/v0.7.2, master) * remove v1 leftovers * improve error handling -- Tobias Oetiker +2020-08-03 08:47:41 +0200 (origin/v0.7.2, v0.7.2) better logging -- Tobias Oetiker +2020-07-28 16:35:54 +0200 fix version numbering -- Tobias Oetiker +2020-07-28 11:27:08 +0200 * remove v1 leftovers * improve error handling -- Tobias Oetiker +2020-07-05 11:57:35 +0000 challengeHandler is gone -- Dominik Hassler 2020-06-10 15:23:25 +0200 (tag: v0.7.1) support openssl 1.1 -- Tobias Oetiker 2020-02-11 22:44:10 +0100 build should honour sysconfdir (#24) -- Dominik Hassler 2019-07-12 13:48:49 +0200 Disclaimer added (#23) -- Samuel Amoser diff --git a/VERSION b/VERSION index 0a1ffad..8bd6ba8 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.7.4 +0.7.5 diff --git a/bin/acmefetch b/bin/acmefetch index 0ac4b67..e89ce08 100755 --- a/bin/acmefetch +++ b/bin/acmefetch @@ -313,17 +313,23 @@ sub getCertificates { my $order = $acme->create_order( identifiers => [ map { { type => 'dns', value => $_ } } sort keys %{$cert->{SITES}} ]); - my @authUrl = $order->authorizations; - my @id = $order->identifiers; - for my $i (0..$#authUrl){ - bla 'debug',"## authorizing $authUrl[$i] ##"; - my $authz = $acme->get_authorization($authUrl[$i]); + #my @authUrl = $order->authorizations; + # my @id = $order->identifiers; + #bla 'debug','auth'.Dumper(\@authUrl); + #bla 'debug','id'.Dumper(\@id); + URL: + for my $url ($order->authorizations){ + my $authz = $acme->get_authorization($url); + my $site = $authz->identifier->{value}; + bla 'debug','## checking '.$site.":\t".$authz->status; + next if $authz->status eq 'valid'; + # bla 'debug', Dumper $authz; my @challenges = $authz->challenges(); my $ok; my $handler; # when the handler gets destroyed the authorization gets remoived too! - for my $challenge ($authz->challenges()){ + for my $challenge (@challenges){ next unless $challenge->type eq 'http-01'; - my $root = $cert->{SITES}{$id[$i]->{value}}{challengeConfig}{www_root}; + my $root = $cert->{SITES}{$site}{challengeConfig}{www_root}; $handler = $challenge->create_handler($acme,$root); $acme->accept_challenge($challenge); $ok = 1; @@ -335,12 +341,12 @@ sub getCertificates { } my $status; while ($status = $acme->poll_authorization($authz)){ - bla 'debug',"## waiting for authorization on ".$id[$i]->{value}." $status"; + bla 'debug',"## waiting for authorization on $site - $status"; last if $status ne 'pending'; sleep 1; } if ($status eq 'invalid'){ - bla 'info',"Failed to authorise $id[$i]->{value}. Probably something wrong with the configuration?"; + bla 'info',"Failed to authorise $site. Probably something wrong with the configuration?"; bla 'info', Dumper($authz); next SITE; } diff --git a/configure b/configure index 56f33a7..2174960 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for AcmeFetch 0.7.3. +# Generated by GNU Autoconf 2.69 for AcmeFetch 0.7.5. # # Report bugs to . # @@ -580,8 +580,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='AcmeFetch' PACKAGE_TARNAME='acmefetch' -PACKAGE_VERSION='0.7.3' -PACKAGE_STRING='AcmeFetch 0.7.3' +PACKAGE_VERSION='0.7.5' +PACKAGE_STRING='AcmeFetch 0.7.5' PACKAGE_BUGREPORT='tobi@oetiker.ch' PACKAGE_URL='' @@ -1295,7 +1295,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures AcmeFetch 0.7.3 to adapt to many kinds of systems. +\`configure' configures AcmeFetch 0.7.5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1362,7 +1362,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of AcmeFetch 0.7.3:";; + short | recursive ) echo "Configuration of AcmeFetch 0.7.5:";; esac cat <<\_ACEOF @@ -1460,7 +1460,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -AcmeFetch configure 0.7.3 +AcmeFetch configure 0.7.5 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1716,7 +1716,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by AcmeFetch $as_me 0.7.3, which was +It was created by AcmeFetch $as_me 0.7.5, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2583,7 +2583,7 @@ fi # Define the identity of the package. PACKAGE='acmefetch' - VERSION='0.7.3' + VERSION='0.7.5' cat >>confdefs.h <<_ACEOF @@ -5258,7 +5258,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by AcmeFetch $as_me 0.7.3, which was +This file was extended by AcmeFetch $as_me 0.7.5, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -5315,7 +5315,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -AcmeFetch config.status 0.7.3 +AcmeFetch config.status 0.7.5 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/man/acmefetch.1 b/man/acmefetch.1 index 505e8d2..d0f7141 100644 --- a/man/acmefetch.1 +++ b/man/acmefetch.1 @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "ACMEFETCH 1" -.TH ACMEFETCH 1 "2020-07-28" "0.7.2" "AcmeFetch" +.TH ACMEFETCH 1 "2020-08-12" "0.7.5" "AcmeFetch" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l