diff options
author | 2015-12-17 15:39:13 +0800 | |
---|---|---|
committer | 2015-12-17 15:39:13 +0800 | |
commit | 05c8a666bd333c8fe14f906b51dfff266ba77e2b (patch) | |
tree | 4fce4e0221ee756faa20fe886932eb7f6512c4e5 /src | |
parent | 60fc10973eb348cb3d99d27f083437ddeab03f14 (diff) | |
parent | c80559d64791e42f8fec9056343f4629720323e4 (diff) | |
download | luaossl-05c8a666bd333c8fe14f906b51dfff266ba77e2b.tar.gz luaossl-05c8a666bd333c8fe14f906b51dfff266ba77e2b.tar.bz2 luaossl-05c8a666bd333c8fe14f906b51dfff266ba77e2b.zip |
Merge branch 'daurnimator-13-setCipherList-args'
Diffstat (limited to 'src')
-rw-r--r-- | src/openssl.ssl.context.lua | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/openssl.ssl.context.lua b/src/openssl.ssl.context.lua index 44a9163..2098b54 100644 --- a/src/openssl.ssl.context.lua +++ b/src/openssl.ssl.context.lua @@ -1,3 +1,16 @@ local ctx = require"_openssl.ssl.context" +local pack = table.pack or function(...) return { n = select("#", ...); ... } end + +-- Allow passing a vararg of ciphers, or an array +local setCipherList; setCipherList = ctx.interpose("setCipherList", function (self, ciphers, ...) + if (...) then + local ciphers_t = pack(ciphers, ...) + ciphers = table.concat(ciphers_t, ":", 1, ciphers_t.n) + elseif type(ciphers) == "table" then + ciphers = table.concat(ciphers, ":") + end + return setCipherList(self, ciphers) +end) + return ctx |