Comparison

net/tls_luasec.lua @ 12486:ee93df086926

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.
author Kim Alvefur <zash@zash.se>
date Wed, 27 Apr 2022 21:34:35 +0200
parent 12480:7e9ebdc75ce4
child 13115:749376d75b40
comparison
equal deleted inserted replaced
12485:794f5ec0f347 12486:ee93df086926
14 abstracts away some of the things which are not needed and simplifies usage of 14 abstracts away some of the things which are not needed and simplifies usage of
15 commonly used things (such as SNI contexts). Eventually, network backends 15 commonly used things (such as SNI contexts). Eventually, network backends
16 which do not rely on LuaSocket+LuaSec should be able to provide *this* API 16 which do not rely on LuaSocket+LuaSec should be able to provide *this* API
17 instead of having to mimic LuaSec. 17 instead of having to mimic LuaSec.
18 ]] 18 ]]
19 local softreq = require"util.dependencies".softreq; 19 local ssl = require "ssl";
20 local ssl = softreq"ssl";
21 local ssl_newcontext = ssl.newcontext; 20 local ssl_newcontext = ssl.newcontext;
22 local ssl_context = ssl.context or softreq"ssl.context"; 21 local ssl_context = ssl.context or require "ssl.context";
23 local io_open = io.open; 22 local io_open = io.open;
24 23
25 local context_api = {}; 24 local context_api = {};
26 local context_mt = {__index = context_api}; 25 local context_mt = {__index = context_api};
27 26