diff --git a/scripts/ssl-enum-ciphers.nse b/scripts/ssl-enum-ciphers.nse index 7cecaa4aa..b10e387d7 100644 --- a/scripts/ssl-enum-ciphers.nse +++ b/scripts/ssl-enum-ciphers.nse @@ -673,7 +673,12 @@ local function find_ciphers_group(host, port, protocol, group, scores) -- This may not always be the case, so -- TODO: reorder certificates and validate entire chain -- TODO: certificate validation (date, self-signed, etc) - local c, err = sslcert.parse_ssl_certificate(certs.certificates[1]) + local c, err + if certs == nil then + stdnse.debug1("Failed to retrieve certificate") + else + c, err = sslcert.parse_ssl_certificate(certs.certificates[1]) + end if not c then stdnse.debug1("Failed to parse certificate: %s", err) elseif c.pubkey.type == kex.pubkey then