Mercurial > prosody-hg
comparison util/sslconfig.lua @ 13502:61da4491eebc
util.sslconfig: Support DH parameters as literal string
Simplifies shipping well-known DH parameters in the config
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Fri, 12 Jul 2024 15:21:08 +0200 |
| parents | d10957394a3c |
| children | 2f754817bf4b |
comparison
equal
deleted
inserted
replaced
| 13501:05f028de4c45 | 13502:61da4491eebc |
|---|---|
| 82 end | 82 end |
| 83 end | 83 end |
| 84 finalisers.certificate = finalisers.key; | 84 finalisers.certificate = finalisers.key; |
| 85 finalisers.cafile = finalisers.key; | 85 finalisers.cafile = finalisers.key; |
| 86 finalisers.capath = finalisers.key; | 86 finalisers.capath = finalisers.key; |
| 87 -- XXX: copied from core/certmanager.lua, but this seems odd, because it would remove a dhparam function from the config | 87 |
| 88 finalisers.dhparam = finalisers.key; | 88 function finalisers.dhparam(value, config) |
| 89 if type(value) == "string" then | |
| 90 if value:sub(1, 10) == "-----BEGIN" then | |
| 91 -- literal value | |
| 92 return value; | |
| 93 else | |
| 94 -- assume a filename | |
| 95 return resolve_path(config._basedir, value); | |
| 96 end | |
| 97 end | |
| 98 end | |
| 89 | 99 |
| 90 -- protocol = "x" should enable only that protocol | 100 -- protocol = "x" should enable only that protocol |
| 91 -- protocol = "x+" should enable x and later versions | 101 -- protocol = "x+" should enable x and later versions |
| 92 | 102 |
| 93 local protocols = { "sslv2", "sslv3", "tlsv1", "tlsv1_1", "tlsv1_2", "tlsv1_3" }; | 103 local protocols = { "sslv2", "sslv3", "tlsv1", "tlsv1_1", "tlsv1_2", "tlsv1_3" }; |
