diff --git a/nselib/imap.lua b/nselib/imap.lua index bd869def9..9126db97b 100644 --- a/nselib/imap.lua +++ b/nselib/imap.lua @@ -93,9 +93,7 @@ IMAP = { -- @return status true on success, false on failure -- @return banner string containing the server banner connect = function(self) - local socket, banner, opt = comm.tryssl( self.host, self.port, "", { recv_before = true } ) - if ( not(socket) ) then return false, "ERROR: Failed to connect to server" end - socket:set_timeout(self.timeout) + local socket, banner, opt = comm.tryssl( self.host, self.port, "", { request_timeout=self.timeout, recv_before=true } ) if ( not(socket) or not(banner) ) then return false, "ERROR: Failed to connect to server" end self.socket = socket return true, banner diff --git a/nselib/pop3.lua b/nselib/pop3.lua index e217a5a41..10fc78228 100644 --- a/nselib/pop3.lua +++ b/nselib/pop3.lua @@ -5,7 +5,6 @@ local base64 = require "base64" local comm = require "comm" -local nmap = require "nmap" local stdnse = require "stdnse" local string = require "string" local table = require "table" @@ -146,7 +145,7 @@ end -- @return nil or String error message. function capabilities(host, port) - local socket, line, bopt, first_line = comm.tryssl(host, port, "" , {timeout=10000, recv_before=true}) + local socket, line, bopt, first_line = comm.tryssl(host, port, "" , {request_timeout=10000, recv_before=true}) if not socket then return nil, "Could Not Connect" end