net.tls_luasec: Harden dependency on LuaSec

We at some point decided that it was okay to have a hard dependency the
TLS library. Especially here since this module is meant to contain all
LuaSec specifics.
This commit is contained in:
Kim Alvefur 2022-04-27 21:34:35 +02:00
parent edb490504d
commit c90b2eca9d

View file

@ -16,10 +16,9 @@ commonly used things (such as SNI contexts). Eventually, network backends
which do not rely on LuaSocket+LuaSec should be able to provide *this* API
instead of having to mimic LuaSec.
]]
local softreq = require"util.dependencies".softreq;
local ssl = softreq"ssl";
local ssl = require "ssl";
local ssl_newcontext = ssl.newcontext;
local ssl_context = ssl.context or softreq"ssl.context";
local ssl_context = ssl.context or require "ssl.context";
local io_open = io.open;
local context_api = {};