Okay so I am running a command like
openssl s_client -showcerts -connect mail.google.com:443
What happens is that it takes about 2 or 3 minutes for the connection to time out and for the script to move on. I can't figure out how to decrease the amount of time it takes for the connection to time out.