Modified check_ssl_certificate to fix bug with expired certs