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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user