Mercurial > prosody-hg
comparison core/certmanager.lua @ 11531:2bd91d4a0fcf
core.certmanager: Check for complete filename
Prevents a false positive match on files with fullchain.pem as suffix
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sat, 10 Apr 2021 14:45:03 +0200 |
| parents | 0bc3acf37428 |
| children | c0c859425c22 |
comparison
equal
deleted
inserted
replaced
| 11530:a90389e7296c | 11531:2bd91d4a0fcf |
|---|---|
| 76 | 76 |
| 77 if stat(crt_path, "mode") == "file" then | 77 if stat(crt_path, "mode") == "file" then |
| 78 if crt_path == key_path then | 78 if crt_path == key_path then |
| 79 if key_path:sub(-4) == ".crt" then | 79 if key_path:sub(-4) == ".crt" then |
| 80 key_path = key_path:sub(1, -4) .. "key"; | 80 key_path = key_path:sub(1, -4) .. "key"; |
| 81 elseif key_path:sub(-13) == "fullchain.pem" then | 81 elseif key_path:sub(-14) == "/fullchain.pem" then |
| 82 key_path = key_path:sub(1, -14) .. "privkey.pem"; | 82 key_path = key_path:sub(1, -14) .. "privkey.pem"; |
| 83 end | 83 end |
| 84 end | 84 end |
| 85 | 85 |
| 86 if stat(key_path, "mode") == "file" then | 86 if stat(key_path, "mode") == "file" then |
