Skip to content

Commit

Permalink
Fix how validate errors are printed
Browse files Browse the repository at this point in the history
Note - previously the error was returned as:
Setting up initial SSL certificate ..
.. domain validation failed : HASH(0x55e6034cb970)
  • Loading branch information
iliajie committed Jun 28, 2024
1 parent 139ae35 commit d673898
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions virtual-server-lib-funcs.pl
Original file line number Diff line number Diff line change
Expand Up @@ -8551,6 +8551,13 @@ sub create_initial_letsencrypt_cert
my @errs = &validate_letsencrypt_config($d, $vcheck);
if (@errs) {
if ($showerrors) {
my @err;
foreach my $e (@errs) {
next if (!$e->{'desc'} || !$e->{'error'});

This comment has been minimized.

Copy link
@jcameron

jcameron Jun 29, 2024

Collaborator

There's no need to check if desc or error are set, because they will be in all elements returned by validate_letsencrypt_config

push(@err, "$e->{'desc'} : ".
"@{[&html_strip($e->{'error'})]}");

This comment has been minimized.

Copy link
@jcameron

jcameron Jun 29, 2024

Collaborator

Why use @{ inside a quoted string that doesn't contain anything else?

}
@errs = @err if (@err);

This comment has been minimized.

Copy link
@jcameron

jcameron Jun 29, 2024

Collaborator

Not needed, because we know for sure that @err will not be empty.

&$second_print(&text('letsencrypt_evalid',
&html_escape(join(", ", @errs))));
}
Expand Down

1 comment on commit d673898

@iliajie
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ref.: Discussed here #841 (comment).

Please sign in to comment.