plugins/tls.lua

changeset 463
98fe3ed54639
parent 428
bde804b01f28
equal deleted inserted replaced
462:51c3da615ff4 463:98fe3ed54639
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(stream.ssl or {mode="client", protocol="sslv23", options="no_sslv2",capath="/etc/ssl/certs"}, true); 21 local sslctx = verse.tls_builder(".")
22 :apply({mode="client", protocol="sslv23", options="no_sslv2",capath="/etc/ssl/certs"})
23 :apply(stream.ssl or {});
24 stream.conn:starttls(sslctx:build(), true);
22 end 25 end
23 end 26 end
24 local function handle_status(new_status) 27 local function handle_status(new_status)
25 if new_status == "ssl-handshake-complete" then 28 if new_status == "ssl-handshake-complete" then
26 stream.secure = true; 29 stream.secure = true;

mercurial