1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-28 02:19:04 +00:00

Enable ssl-heartbleed to connect to STARTTLS services

This commit is contained in:
dmiller
2014-04-09 17:34:39 +00:00
parent d1a86b7f57
commit c69afa24aa

View File

@@ -158,14 +158,26 @@ local function testversion(host, port, version)
})
)
local s = nmap.new_socket()
s:set_timeout(5000)
if not s:connect(host, port, "tcp") then
stdnse.print_debug(3, "Connection to server failed")
return
local s
local specialized = sslcert.getPrepareTLSWithoutReconnect(port)
if specialized then
local status
status, s = specialized(host, port)
if not status then
stdnse.print_debug(3, "Connection to server failed")
return
end
else
s = nmap.new_socket()
local status = s:connect(host, port)
if not status then
stdnse.print_debug(3, "Connection to server failed")
return
end
end
s:set_timeout(5000)
if not s:send(hello) then
stdnse.print_debug(3, "Failed to send packet to server")
return