Comparison

plugins/tls.lua @ 463:98fe3ed54639

Update to new tls_builder() API in net.server upstream
author Matthew Wild <mwild1@gmail.com>
date Thu, 16 Mar 2023 16:40:57 +0000
parent 428:bde804b01f28
comparison
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;