mirror of
https://github.com/drwetter/testssl.sh.git
synced 2025-01-03 23:39:45 +01:00
Merge pull request #937 from dcooper16/fix_certificate_check
Fix check for whether certificates were found
This commit is contained in:
commit
4339c27659
@ -5950,7 +5950,7 @@ get_server_certificate() {
|
||||
local success
|
||||
local npn_params="" line
|
||||
local savedir
|
||||
local nrsaved
|
||||
local nrsaved=0
|
||||
|
||||
"$HAS_SPDY" && [[ -z "$STARTTLS" ]] && npn_params="-nextprotoneg \"$NPN_PROTOs\""
|
||||
|
||||
@ -5975,7 +5975,7 @@ get_server_certificate() {
|
||||
/-----BEGIN CERTIFICATE-----/{ if (start) {inc=1; n++} }
|
||||
inc { print > ("level" n ".crt") }
|
||||
/---END CERTIFICATE-----/{ inc=0 }' $TMPFILE
|
||||
nrsaved=$(count_words "$(echo level?.crt 2>/dev/null)")
|
||||
[[ -s level0.crt ]] && nrsaved=$(count_words "$(echo level?.crt 2>/dev/null)")
|
||||
if [[ $nrsaved -eq 0 ]]; then
|
||||
success=1
|
||||
else
|
||||
@ -6039,7 +6039,7 @@ get_server_certificate() {
|
||||
/-----BEGIN CERTIFICATE-----/{ if (start) {inc=1; n++} }
|
||||
inc { print > ("level" n ".crt") }
|
||||
/---END CERTIFICATE-----/{ inc=0 }' $TMPFILE
|
||||
nrsaved=$(count_words "$(echo level?.crt 2>/dev/null)")
|
||||
[[ -s level0.crt ]] && nrsaved=$(count_words "$(echo level?.crt 2>/dev/null)")
|
||||
if [[ $nrsaved -eq 0 ]]; then
|
||||
success=1
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user