-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ssl) configurable ssl cipher suites
Provide a shorthand config option to define cipher suites based on Mozilla's recommended cipher list, and an optional config to define custom ciphers.
- Loading branch information
Showing
7 changed files
with
188 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
local _ciphers = { | ||
modern = { | ||
"ECDHE-ECDSA-AES256-GCM-SHA384", | ||
"ECDHE-RSA-AES256-GCM-SHA384", | ||
"ECDHE-ECDSA-CHACHA20-POLY1305", | ||
"ECDHE-RSA-CHACHA20-POLY1305", | ||
"ECDHE-ECDSA-AES128-GCM-SHA256", | ||
"ECDHE-RSA-AES128-GCM-SHA256", | ||
"ECDHE-ECDSA-AES256-SHA384", | ||
"ECDHE-RSA-AES256-SHA384", | ||
"ECDHE-ECDSA-AES128-SHA256", | ||
"ECDHE-RSA-AES128-SHA256", | ||
}, | ||
intermediate = { | ||
"ECDHE-ECDSA-CHACHA20-POLY1305", | ||
"ECDHE-RSA-CHACHA20-POLY1305", | ||
"ECDHE-ECDSA-AES128-GCM-SHA256", | ||
"ECDHE-RSA-AES128-GCM-SHA256", | ||
"ECDHE-ECDSA-AES256-GCM-SHA384", | ||
"ECDHE-RSA-AES256-GCM-SHA384", | ||
"DHE-RSA-AES128-GCM-SHA256", | ||
"DHE-RSA-AES256-GCM-SHA384", | ||
"ECDHE-ECDSA-AES128-SHA256", | ||
"ECDHE-RSA-AES128-SHA256", | ||
"ECDHE-ECDSA-AES128-SHA", | ||
"ECDHE-RSA-AES256-SHA384", | ||
"ECDHE-RSA-AES128-SHA", | ||
"ECDHE-ECDSA-AES256-SHA384", | ||
"ECDHE-ECDSA-AES256-SHA", | ||
"ECDHE-RSA-AES256-SHA", | ||
"DHE-RSA-AES128-SHA256", | ||
"DHE-RSA-AES128-SHA", | ||
"DHE-RSA-AES256-SHA256", | ||
"DHE-RSA-AES256-SHA", | ||
"ECDHE-ECDSA-DES-CBC3-SHA", | ||
"ECDHE-RSA-DES-CBC3-SHA", | ||
"EDH-RSA-DES-CBC3-SHA", | ||
"AES128-GCM-SHA256", | ||
"AES256-GCM-SHA384", | ||
"AES128-SHA256", | ||
"AES256-SHA256", | ||
"AES128-SHA", | ||
"AES256-SHA", | ||
"DES-CBC3-SHA", | ||
"!DSS", | ||
}, | ||
old = { | ||
"ECDHE-ECDSA-CHACHA20-POLY1305", | ||
"ECDHE-RSA-CHACHA20-POLY1305", | ||
"ECDHE-RSA-AES128-GCM-SHA256", | ||
"ECDHE-ECDSA-AES128-GCM-SHA256", | ||
"ECDHE-RSA-AES256-GCM-SHA384", | ||
"ECDHE-ECDSA-AES256-GCM-SHA384", | ||
"DHE-RSA-AES128-GCM-SHA256", | ||
"DHE-DSS-AES128-GCM-SHA256", | ||
"kEDH+AESGCM", | ||
"ECDHE-RSA-AES128-SHA256", | ||
"ECDHE-ECDSA-AES128-SHA256", | ||
"ECDHE-RSA-AES128-SHA", | ||
"ECDHE-ECDSA-AES128-SHA", | ||
"ECDHE-RSA-AES256-SHA384", | ||
"ECDHE-ECDSA-AES256-SHA384", | ||
"ECDHE-RSA-AES256-SHA", | ||
"ECDHE-ECDSA-AES256-SHA", | ||
"DHE-RSA-AES128-SHA256", | ||
"DHE-RSA-AES128-SHA", | ||
"DHE-DSS-AES128-SHA256", | ||
"DHE-RSA-AES256-SHA256", | ||
"DHE-DSS-AES256-SHA", | ||
"DHE-RSA-AES256-SHA", | ||
"ECDHE-RSA-DES-CBC3-SHA", | ||
"ECDHE-ECDSA-DES-CBC3-SHA", | ||
"EDH-RSA-DES-CBC3-SHA", | ||
"AES128-GCM-SHA256", | ||
"AES256-GCM-SHA384", | ||
"AES128-SHA256", | ||
"AES256-SHA256", | ||
"AES128-SHA", | ||
"AES256-SHA", | ||
"AES", | ||
"DES-CBC3-SHA", | ||
"HIGH", | ||
"SEED", | ||
"!aNULL", | ||
"!eNULL", | ||
"!EXPORT", | ||
"!DES", | ||
"!RC4", | ||
"!MD5", | ||
"!PSK", | ||
"!RSAPSK", | ||
"!aDH", | ||
"!aECDH", | ||
"!EDH-DSS-DES-CBC3-SHA", | ||
"!KRB5-DES-CBC3-SHA", | ||
"!SRP", | ||
}, | ||
} | ||
|
||
|
||
local ciphers = setmetatable(_ciphers, { | ||
__index = function(t, k) error("Undefined cipher suite " .. tostring(k)) end, | ||
}) | ||
|
||
|
||
local function build_cipher_string(suite) | ||
return table.concat(ciphers[suite], ":") | ||
end | ||
|
||
|
||
return setmetatable({}, { | ||
__call = function(_, suite) | ||
return build_cipher_string(suite) | ||
end, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters