Skip to content

Commit 26f0c65

Browse files
committed
SSL CA validation improvements
1 parent 179cca9 commit 26f0c65

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

func/domain.sh

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -327,15 +327,9 @@ is_web_domain_cert_valid() {
327327
fi
328328

329329
if [ -e "$ssl_dir/$domain.ca" ]; then
330-
ca_vrf=$(openssl verify $ssl_dir/$domain.ca 2>/dev/null |grep 'OK')
331-
if [ -z "$ca_vrf" ]; then
332-
echo "Error: ssl certificate authority is not valid"
333-
log_event "$E_INVALID" "$EVENT"
334-
exit $E_INVALID
335-
fi
336-
337-
crt_vrf=$(openssl verify -untrusted $ssl_dir/$domain.ca \
338-
$ssl_dir/$domain.crt 2>/dev/null |grep 'OK')
330+
crt_vrf=$(openssl verify -purpose sslserver \
331+
-CAfile $ssl_dir/$domain.ca $ssl_dir/$domain.crt 2>/dev/null |\
332+
grep 'OK')
339333
if [ -z "$crt_vrf" ]; then
340334
echo "Error: root or/and intermediate cerificate not found"
341335
log_event "$E_NOTEXIST" "$EVENT"

0 commit comments

Comments
 (0)