mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 18:49:21 -07:00
SSL CA validation improvements
This commit is contained in:
parent
179cca9566
commit
26f0c65953
1 changed files with 3 additions and 9 deletions
|
@ -327,15 +327,9 @@ is_web_domain_cert_valid() {
|
|||
fi
|
||||
|
||||
if [ -e "$ssl_dir/$domain.ca" ]; then
|
||||
ca_vrf=$(openssl verify $ssl_dir/$domain.ca 2>/dev/null |grep 'OK')
|
||||
if [ -z "$ca_vrf" ]; then
|
||||
echo "Error: ssl certificate authority is not valid"
|
||||
log_event "$E_INVALID" "$EVENT"
|
||||
exit $E_INVALID
|
||||
fi
|
||||
|
||||
crt_vrf=$(openssl verify -untrusted $ssl_dir/$domain.ca \
|
||||
$ssl_dir/$domain.crt 2>/dev/null |grep 'OK')
|
||||
crt_vrf=$(openssl verify -purpose sslserver \
|
||||
-CAfile $ssl_dir/$domain.ca $ssl_dir/$domain.crt 2>/dev/null |\
|
||||
grep 'OK')
|
||||
if [ -z "$crt_vrf" ]; then
|
||||
echo "Error: root or/and intermediate cerificate not found"
|
||||
log_event "$E_NOTEXIST" "$EVENT"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue