reduced number of retries by 1

This commit is contained in:
nervuri 2021-06-04 11:22:35 +00:00
parent feb651d698
commit bdd4db2df9
Signed by: nervuri
GPG Key ID: C4769EEA7BA61672
1 changed files with 3 additions and 10 deletions

View File

@ -33,18 +33,11 @@ fetch_cert() (
response=$($timeout $torsocks openssl s_client -connect "$hp" </dev/null 2>/dev/null \
| sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p')
# If no response, try again.
if [ -z "$response" ]; then
# If no response and Tor was not used, try again.
if [ -z "$response" ] && [ -z "$torsocks" ]; then
sleep 5
response=$($timeout $torsocks openssl s_client -connect "$hp" </dev/null 2>/dev/null \
response=$($timeout openssl s_client -connect "$hp" </dev/null 2>/dev/null \
| sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p')
# If still no response and Tor was not used, try one last time.
if [ -z "$response" ] && [ -z "$torsocks" ]; then
sleep 10
response=$($timeout openssl s_client -connect "$hp" </dev/null 2>/dev/null \
| sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p')
fi
fi
echo "$response"