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
+19
View File
@@ -121,6 +121,25 @@ function startRedirectServer() {
http
.createServer((req, res) => {
// DER for Apple tooling, PEM for everything else.
if (req.url === '/ca.cer' || req.url === '/ca.der') {
try {
const der = tls.caCertificateDer();
if (!der) {
res.writeHead(404, { 'Content-Type': 'text/plain' });
return res.end('No certificate authority has been generated yet.');
}
res.writeHead(200, {
'Content-Type': 'application/pkix-cert',
'Content-Disposition': 'attachment; filename="visitor-signin-ca.cer"',
});
return res.end(der);
} catch (err) {
res.writeHead(500, { 'Content-Type': 'text/plain' });
return res.end(`Could not convert the certificate: ${err.message}`);
}
}
if (req.url === '/ca.crt' || req.url === '/ca.pem') {
const ca = tls.caCertificate();
if (!ca) {