diff --git a/get-certs.sh b/get-certs.sh index 5b00847..49740e6 100755 --- a/get-certs.sh +++ b/get-certs.sh @@ -33,18 +33,11 @@ fetch_cert() ( response=$($timeout $torsocks openssl s_client -connect "$hp" /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 \ + response=$($timeout openssl s_client -connect "$hp" /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 \ - | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p') - fi fi echo "$response"