mirror of
https://github.com/myvesta/vesta
synced 2025-08-19 21:04:07 -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
|
fi
|
||||||
|
|
||||||
if [ -e "$ssl_dir/$domain.ca" ]; then
|
if [ -e "$ssl_dir/$domain.ca" ]; then
|
||||||
ca_vrf=$(openssl verify $ssl_dir/$domain.ca 2>/dev/null |grep 'OK')
|
crt_vrf=$(openssl verify -purpose sslserver \
|
||||||
if [ -z "$ca_vrf" ]; then
|
-CAfile $ssl_dir/$domain.ca $ssl_dir/$domain.crt 2>/dev/null |\
|
||||||
echo "Error: ssl certificate authority is not valid"
|
grep 'OK')
|
||||||
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')
|
|
||||||
if [ -z "$crt_vrf" ]; then
|
if [ -z "$crt_vrf" ]; then
|
||||||
echo "Error: root or/and intermediate cerificate not found"
|
echo "Error: root or/and intermediate cerificate not found"
|
||||||
log_event "$E_NOTEXIST" "$EVENT"
|
log_event "$E_NOTEXIST" "$EVENT"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue