CertZipDL

This commit is contained in:
jessikitty committed 2026-09-16 10:05:57 +10:00
1 parent b1a793302d
commit 922ce99d25
13 files changed
+577 -63

No files matched your search

+14
View File
@@ -1275,6 +1275,20 @@ router.get(['/tls/ca.cer', '/tls/ca.der'], (req, res) => {
}
});
/** All encodings plus instructions, as one archive browsers will actually download. */
router.get('/tls/ca-bundle.zip', (req, res) => {
try {
const zip = tls.caBundleZip();
if (!zip) return res.status(404).send('No certificate authority has been generated yet.');
res.setHeader('Content-Type', 'application/zip');
res.setHeader('Content-Disposition', 'attachment; filename="visitor-signin-certificates.zip"');
res.setHeader('Content-Length', zip.length);
res.send(zip);
} catch (err) {
res.status(500).send(`Could not build the bundle: ${err.message}`);
}
});
router.post('/tls/renew', requireOwner, (req, res) => {
try {
// A brand new CA means every kiosk device has to trust it again, so it is