test.lua
changeset 57 37ed3c7ac1b6
parent 53 2dcfa81100e4
equal deleted inserted replaced
56:d53804c0fb6f 57:37ed3c7ac1b6
    28 local sent = false
    28 local sent = false
    29 
    29 
    30 local username, server = arg[1]:match ( '(.+)@(.+)' )
    30 local username, server = arg[1]:match ( '(.+)@(.+)' )
    31 local password         = arg[2]
    31 local password         = arg[2]
    32 local recipient        = arg[3] or arg[1]
    32 local recipient        = arg[3] or arg[1]
    33 local fingerprint      = arg[4] or '01:23:45:67:89:ab:cd:ef:fe:dc:ba:98:76:54:32:10'
    33 local fingerprint      = arg[4]
       
    34 
       
    35 if not fingerprint then
       
    36 	local ssl_fp_format = lm.ssl.supported ()
       
    37 	if ssl_fp_format then
       
    38 		if ssl_fp_format == 'MD5' then
       
    39 			fingerprint = '01:23:45:67:89:ab:cd:ef:fe:dc:ba:98:76:54:32:10'
       
    40 		else
       
    41 			fingerprint = 'SHA256:0123456789abcdeffedcba98765432100123456789acbdeffedcba9876543210'
       
    42 		end
       
    43 	end
       
    44 end
    34 
    45 
    35 print ( ("Connectng to %s with username %s\nWill contact %s."):format ( server, username, recipient ) )
    46 print ( ("Connectng to %s with username %s\nWill contact %s."):format ( server, username, recipient ) )
    36 
    47 
    37 --[[
    48 --[[
    38 -- What's goes on, pretty close to C api,
    49 -- What's goes on, pretty close to C api,
   143 
   154 
   144 print ( 'Closing connection... ' )
   155 print ( 'Closing connection... ' )
   145 conn:close ()
   156 conn:close ()
   146 print ( "Bye" )
   157 print ( "Bye" )
   147 
   158 
   148 -- vim: se ts=4: --
   159 -- vim: se ts=4 sw=4: --