1
0
mirror of https://github.com/nmap/nmap.git synced 2026-02-03 20:16:33 +00:00

Recognize Z/OS error messages related to FTP over TLS. Close #3255, fix #2315

This commit is contained in:
nnposter
2026-02-02 02:00:38 +00:00
parent a6c2b5e7ee
commit f42bcd8b7e

View File

@@ -115,11 +115,14 @@ end
-- Should we try STARTTLS based on this error?
local function should_try_ssl(code, message)
return code and code >= 400 and (
message:match('[Ss][Ss][Ll]') or
message:match('[Tt][Ll][Ss]') or
message:match('[Ss][Ee][Cc][Uu][Rr]')
)
if not code or code < 400 then return false end
message = message:lower()
return message:find("ssl", 1, true) or
message:find("tls", 1, true) or
message:find("secur", 1, true) or
-- z/OS Communications Server
-- https://www.ibm.com/docs/en/zos/2.4.0?topic=codes-534-reply
message:find("server requires authentication before", 1, true)
end
-- Try to reconnect over STARTTLS.