Software /
code /
verse
Changeset
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 |
parents | 462:51c3da615ff4 |
children | 464:dc05a8d6dbfb |
files | init.lua plugins/tls.lua squishy |
diffstat | 3 files changed, 11 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/init.lua Thu Mar 16 11:47:37 2023 +0000 +++ b/init.lua Thu Mar 16 16:40:57 2023 +0000 @@ -97,6 +97,10 @@ return server.setquitting("once"); end +function verse.tls_builder(...) + return server.tls_builder(...); +end + function stream:listen(host, port) host = host or "localhost"; port = port or 0;
--- a/plugins/tls.lua Thu Mar 16 11:47:37 2023 +0000 +++ b/plugins/tls.lua Thu Mar 16 16:40:57 2023 +0000 @@ -18,7 +18,10 @@ local function handle_tls(tls_status) if tls_status.name == "proceed" then stream:debug("Server says proceed, handshake starting..."); - stream.conn:starttls(stream.ssl or {mode="client", protocol="sslv23", options="no_sslv2",capath="/etc/ssl/certs"}, true); + local sslctx = verse.tls_builder(".") + :apply({mode="client", protocol="sslv23", options="no_sslv2",capath="/etc/ssl/certs"}) + :apply(stream.ssl or {}); + stream.conn:starttls(sslctx:build(), true); end end local function handle_status(new_status)
--- a/squishy Thu Mar 16 11:47:37 2023 +0000 +++ b/squishy Thu Mar 16 16:40:57 2023 +0000 @@ -40,7 +40,10 @@ Module "util.ip" "util/ip.lua" Module "util.time" "util/time.lua" Module "util.hex" "util/hex.lua" +Module "util.sslconfig" "util/sslconfig.lua" +Module "util.paths" "util/paths.lua" Module "util.mathcompat" "util/mathcompat.lua" +Module "net.tls_luasec" "net/tls_luasec.lua" Module "util.sasl.scram" "util/sasl/scram.lua" Module "util.sasl.plain" "util/sasl/plain.lua"