SSL Cert Fixes

This commit is contained in:
2026-09-07 09:43:36 +10:00
parent 5afccaffa8
commit fc2898083c
6 changed files with 96 additions and 1 deletions
+18
View File
@@ -1224,6 +1224,24 @@ router.get('/tls/ca.crt', (req, res) => {
res.send(ca);
});
/**
* The same authority in DER form, for Jamf Pro and anything else built on Apple's
* tooling. Offered as .cer and .der because different consoles insist on
* different extensions for the identical bytes.
*/
router.get(['/tls/ca.cer', '/tls/ca.der'], (req, res) => {
try {
const der = tls.caCertificateDer();
if (!der) return res.status(404).send('No certificate authority has been generated yet.');
const ext = req.path.endsWith('.der') ? 'der' : 'cer';
res.setHeader('Content-Type', 'application/pkix-cert');
res.setHeader('Content-Disposition', `attachment; filename="visitor-signin-ca.${ext}"`);
res.send(der);
} catch (err) {
res.status(500).send(`Could not convert the certificate: ${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