--- a/test.lua Sat Mar 05 14:55:50 2016 +0200
+++ b/test.lua Sat Mar 05 14:57:47 2016 +0200
@@ -30,7 +30,18 @@
local username, server = arg[1]:match ( '(.+)@(.+)' )
local password = arg[2]
local recipient = arg[3] or arg[1]
-local fingerprint = arg[4] or '01:23:45:67:89:ab:cd:ef:fe:dc:ba:98:76:54:32:10'
+local fingerprint = arg[4]
+
+if not fingerprint then
+ local ssl_fp_format = lm.ssl.supported ()
+ if ssl_fp_format then
+ if ssl_fp_format == 'MD5' then
+ fingerprint = '01:23:45:67:89:ab:cd:ef:fe:dc:ba:98:76:54:32:10'
+ else
+ fingerprint = 'SHA256:0123456789abcdeffedcba98765432100123456789acbdeffedcba9876543210'
+ end
+ end
+end
print ( ("Connectng to %s with username %s\nWill contact %s."):format ( server, username, recipient ) )
@@ -145,4 +156,4 @@
conn:close ()
print ( "Bye" )
--- vim: se ts=4: --
+-- vim: se ts=4 sw=4: --