mirror of
https://github.com/drwetter/testssl.sh.git
synced 2025-01-06 00:39:44 +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 success
|
||||||
local npn_params="" line
|
local npn_params="" line
|
||||||
local savedir
|
local savedir
|
||||||
local nrsaved
|
local nrsaved=0
|
||||||
|
|
||||||
"$HAS_SPDY" && [[ -z "$STARTTLS" ]] && npn_params="-nextprotoneg \"$NPN_PROTOs\""
|
"$HAS_SPDY" && [[ -z "$STARTTLS" ]] && npn_params="-nextprotoneg \"$NPN_PROTOs\""
|
||||||
|
|
||||||
@ -5975,7 +5975,7 @@ get_server_certificate() {
|
|||||||
/-----BEGIN CERTIFICATE-----/{ if (start) {inc=1; n++} }
|
/-----BEGIN CERTIFICATE-----/{ if (start) {inc=1; n++} }
|
||||||
inc { print > ("level" n ".crt") }
|
inc { print > ("level" n ".crt") }
|
||||||
/---END CERTIFICATE-----/{ inc=0 }' $TMPFILE
|
/---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
|
if [[ $nrsaved -eq 0 ]]; then
|
||||||
success=1
|
success=1
|
||||||
else
|
else
|
||||||
@ -6039,7 +6039,7 @@ get_server_certificate() {
|
|||||||
/-----BEGIN CERTIFICATE-----/{ if (start) {inc=1; n++} }
|
/-----BEGIN CERTIFICATE-----/{ if (start) {inc=1; n++} }
|
||||||
inc { print > ("level" n ".crt") }
|
inc { print > ("level" n ".crt") }
|
||||||
/---END CERTIFICATE-----/{ inc=0 }' $TMPFILE
|
/---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
|
if [[ $nrsaved -eq 0 ]]; then
|
||||||
success=1
|
success=1
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user