diff options
Diffstat (limited to 'src/openssl.ssl.lua')
-rw-r--r-- | src/openssl.ssl.lua | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/openssl.ssl.lua b/src/openssl.ssl.lua index 2a18024..4f9f82b 100644 --- a/src/openssl.ssl.lua +++ b/src/openssl.ssl.lua @@ -22,4 +22,18 @@ if setCurvesList then end) end +-- Allow passing a vararg of ciphersuites, or an array +local setCipherSuites = ssl.interpose("setCipherSuites", nil) +if setCipherSuites then + ssl.interpose("setCipherSuites", 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 setCipherSuites(self, ciphers) + end) +end + return ssl |