summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/openssl.ssl.context.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/openssl.ssl.context.lua b/src/openssl.ssl.context.lua
index 44a9163..2da84de 100644
--- a/src/openssl.ssl.context.lua
+++ b/src/openssl.ssl.context.lua
@@ -1,3 +1,16 @@
1local ctx = require"_openssl.ssl.context" 1local ctx = require"_openssl.ssl.context"
2 2
3local pack = table.pack or function(...) return { n = select("#", ...); ... } end
4
5-- Allow passing a vararg of ciphers, or an array
6local setCipherList; setCipherList = ctx.interpose("setCipherList", function (self, ciphers, ...)
7 if (...) then
8 local ciphers_t = pack(...)
9 ciphers = table.concat(ciphers_t, ":", 1, ciphers_t.n)
10 elseif type(ciphers) == "table" then
11 ciphers = table.concat(ciphers, ":")
12 end
13 return setCipherList(self, ciphers)
14end)
15
3return ctx 16return ctx