I'm using openssl to check if there is tlsv1.3 support or not over the list of domains. I've write the script but the script doesn't get stopped its waits for me to press CTRL+D than it gives me a result. here is the scirpt
!/usr/bin/env bash
filename='domains.txt'
while read line;do
domain=$line
if openssl s_client -connect $domain:443 -tls1_3 2>/dev/null | grep -q 'Protocol : TLSv1.3'; then
echo "tls V 1.3 being used "
else
echo "tls v 1.3 not begin used"
fi
done <$filename
I've also used echo with openssl like this
echo "x" | openssl s_client -connect www.example.com:443 -tls1_3 2>/dev/null | grep 'Protocol : TLSv1.3'
NOTE: When i run the command on terminal for individual site i get the result without typing CRTL+D but when i used it in script using loop and if statement its waits for me to press CTRL+D. Its really strange.
I've also tried echo "q" | openssl command
Do like:
echo Q | timeout 1 openssl s_client -connect www.example.com:443 -tls1_3 2>/dev/null
Passing Q will make it quit fast, and when can't connect timeout will make it quit.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With