From 7ec99c4900b7fd6117fc20e70c76eba4c8032f6f Mon Sep 17 00:00:00 2001 From: jake Date: Fri, 26 Aug 2022 07:59:08 -0400 Subject: Fix certificate setting errorously emiting an error when client did not present certificate Fix in redirection setting again --- gmi.pl | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) (limited to 'gmi.pl') diff --git a/gmi.pl b/gmi.pl index 8381ecf..246b809 100755 --- a/gmi.pl +++ b/gmi.pl @@ -7,7 +7,7 @@ use warnings; use 5.010; #use diagnostics; -our $VERSION = 'v0.17.1'; +our $VERSION = 'v0.17.2'; # Modules use IO::Socket::SSL; # CPAN @@ -1092,18 +1092,19 @@ sub redirection_parameter { $vhost = 'default'; } - ## no critic (cascading) - if ($r eq 'no') { - return 0; - } - elsif ($r eq 'simple') { - return 1; - } - elsif ($r eq 'regex') { - return 2; - } - elsif ($r) { - serr("'$vhost': Given redirection parameter is invalid: $r"); + if ($r) { + if ($r eq 'no') { + return 0; + } + elsif ($r eq 'simple') { + return 1; + } + elsif ($r eq 'regex') { + return 2; + } + else { + serr("'$vhost': Given redirection parameter is invalid: $r"); + } } return; @@ -1200,8 +1201,13 @@ sub cert_req { } } # must be string, hopefully 'any' - elsif ($cert_req->{$key} eq 'any' and defined $cl_cert) { - return 0; + elsif ($cert_req->{$key} eq 'any') { + if (defined $cl_cert) { + return 0; + } + else { + return 1; + } } else { serr("'$vhost': certs: when not an array, it must be 'any'."); -- cgit v1.2.3