glass-isc-dhcp
glass-isc-dhcp copied to clipboard
Certificate - www file modified for https
Below is the /opt/glass-isc-dhcp/bin/www file that has been modified to use the certificates created for another service (Librenms) my Ubuntu server provides. It took some hunting around and progressive failures to get it right...especially since this is my first foray into Nodejs. Incidentally the Nodjs version the ubuntu server is on is v10.19.0 so those of you who were wondering about the outdated 8 version in the installation docs. As of the date of writing this Ubuntu is fully patched. The following code was added:
/**
* Set up for https.
*/
const https = require('https');
const fs = require('fs');
var tls = require('tls');
const options = {
key: fs.readFileSync('/etc/ssl/private/server.key'),
cert: fs.readFileSync('/etc/ssl/certs/cmg-net01.pem')
};
and the server line was modified to include the options from above:
/**
* Create HTTPs server.
*/
var server = https.createServer(options,app);
https works using these changes but viewing logs via websocket doesn't work
Huh. Let me know if you figure that one out - no time to focus on it at the moment.