I'm using wget to check if several boxes have access to other servers. The problem is sometimes the servers attempt to self-sign and the script hangs when this happens. It simply stops on the line
To connect to www.google.com insecurely, use '--no-check-certificate'.
I don't necessarily want to do --no-check-certificate as all I need is this line:
Connecting to https://www.google.com|xx.xxx.xxx.xxx... connected
and I understand the no check certificate to not necessarily be a secure option.
Is there a way to get wget to stop, timeout, or otherwise cancel if it encounters a server with a self-signed certificate?
EDIT: I forgot to mention I'm on SunOS 10 with WGET 1.12. An example of the wget line I'm using is
variable[i]=$(wget -O- --no-http-keep-alive https://www.google.com | grep connected)
wget
should terminate immediately after it aborts due to an untrusted certificate. I don't know why it isn't in your case. But you also say that all you need to do is connect, you don't need to actually perform an HTTPS request, so why don't you use something likenc
which will just connect to the remote host and port and do nothing else?--no-check-certificate
? The security issue is that, with an unverified certificate, someone might have forged it and so be able to snoop on your data traffic. But since you don't actually seem to be sending anything, there is no sensitive data to protect in the first place.--no-check-certificate
also has the implication that you don't know whether it's the intended server that's responding, or an usurper of its IP address.wget -O- --no-http-keep-alive https://www.google.com | grep connected
doesn't make sense, do you want to grep the web page content?