Comparison

plugins/tls.lua @ 399:82ad158714e5

Merge with Zash
author Matthew Wild <mwild1@gmail.com>
date Tue, 12 Jan 2016 13:14:36 +0000
parent 384:532a379acfea
child 428:bde804b01f28
comparison
equal deleted inserted replaced
378:6042c938e369 399:82ad158714e5
16 end 16 end
17 end 17 end
18 local function handle_tls(tls_status) 18 local function handle_tls(tls_status)
19 if tls_status.name == "proceed" then 19 if tls_status.name == "proceed" then
20 stream:debug("Server says proceed, handshake starting..."); 20 stream:debug("Server says proceed, handshake starting...");
21 stream.conn:starttls({mode="client", protocol="sslv23", options="no_sslv2"}, true); 21 stream.conn:starttls(stream.ssl or {mode="client", protocol="sslv23", options="no_sslv2",capath="/etc/ssl/certs"}, true);
22 end 22 end
23 end 23 end
24 local function handle_status(new_status) 24 local function handle_status(new_status)
25 if new_status == "ssl-handshake-complete" then 25 if new_status == "ssl-handshake-complete" then
26 stream.secure = true; 26 stream.secure = true;
29 end 29 end
30 end 30 end
31 stream:hook("stream-features", handle_features, 400); 31 stream:hook("stream-features", handle_features, 400);
32 stream:hook("stream/"..xmlns_tls, handle_tls); 32 stream:hook("stream/"..xmlns_tls, handle_tls);
33 stream:hook("status", handle_status, 400); 33 stream:hook("status", handle_status, 400);
34 34
35 return true; 35 return true;
36 end 36 end