mirror of
https://github.com/nmap/nmap.git
synced 2026-06-30 05:05:53 +00:00
Merge d28e9b762b into 806c0af5ee
This commit is contained in:
commit
a2e2ee9908
1 changed files with 8 additions and 1 deletions
|
|
@ -222,12 +222,19 @@ end
|
|||
|
||||
local connect_tls = function(s, xmlns, server_name)
|
||||
local request = make_request(server_name, xmlns)
|
||||
request = request .. "<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>"
|
||||
s:send(request)
|
||||
while true do
|
||||
local tag = receive_tag(s)
|
||||
if not tag then break end
|
||||
log_tag(tag)
|
||||
if (tag.name == "required" or tag.name == "starttls") and tag.finish then
|
||||
request = "<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>"
|
||||
local status, err = s:send(request)
|
||||
if ( not(status) ) then
|
||||
return false
|
||||
end
|
||||
tag = receive_tag(s)
|
||||
end
|
||||
if tag.name == "proceed" and tag.finish then
|
||||
local status, error = s:reconnect_ssl()
|
||||
if status then return true end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue