diff options
Diffstat (limited to 'src/openssl.ssl.context.lua')
-rw-r--r-- | src/openssl.ssl.context.lua | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/src/openssl.ssl.context.lua b/src/openssl.ssl.context.lua index 54cbad7..db1e704 100644 --- a/src/openssl.ssl.context.lua +++ b/src/openssl.ssl.context.lua @@ -13,20 +13,6 @@ local setCipherList; setCipherList = ctx.interpose("setCipherList", function (se return setCipherList(self, ciphers) end) --- Allow passing a vararg of curves, or an array -local setCurvesList = ctx.interpose("setCurvesList", nil) -if setCurvesList then - ctx.interpose("setCurvesList", function (self, curves, ...) - if (...) then - local curves_t = pack(curves, ...) - curves = table.concat(curves_t, ":", 1, curves_t.n) - elseif type(curves) == "table" then - curves = table.concat(curves, ":") - end - return setCurvesList(self, curves) - end) -end - -- Allow passing a vararg of ciphersuites, or an array local setCipherSuites = ctx.interpose("setCipherSuites", nil) if setCipherSuites then @@ -41,4 +27,20 @@ if setCipherSuites then end) end +-- Allow passing a vararg of curves, or an array +local setGroups = ctx.interpose("setGroups", nil) +if setGroups then + local function varargSetGroups(self, group, ...) + if (...) then + local group_t = pack(group, ...) + group = table.concat(group_t, ":", 1, group_t.n) + elseif type(group) == "table" then + group = table.concat(group, ":") + end + return setGroups(self, group) + end + ctx.interpose("setGroups", varargSetGroups) + ctx.interpose("setCurvesList", varargSetGroups) +end + return ctx |