I have a list of IPs I need to check if they support TLS1.2, and I am using Openssl for that. However I can't seem to automate the process within the Bash script. It only executes on first IP and waits for my input. I read I have to either add < /dev/null or echo "x" but it does not help. I tried:
for i in `cat scope`; do openssl s_client -tls1_2 -connect $i:443 < /dev/null; done
or:
for i in `cat scope`; do echo "x" | openssl s_client -tls1_2 -connect $i:443 < /dev/null; done
EDIT: solved, port 443 was not open on 2nd IP, that's why it was waiting.
openssl s_client -tls1_2 -connect $(head -1 scope):443 < /dev/null. However if I run that using for loop it just stops after 1 IP is checked.openssl s_client -tls1_2 -connect $(sed -n 2p scope):443 < /dev/null)? Or perhaps the second IP does not respond and thus, the process just hangs? In that case (hang case), try adding something liketimeout 10beforeopenssl.scope? I couldn't reproduce the problem with a random example...