handle timeouts and invalid SSL certs more gracefully.