glass-isc-dhcp icon indicating copy to clipboard operation
glass-isc-dhcp copied to clipboard

Certificate - www file modified for https

Open tmacgbay opened this issue 4 years ago • 2 comments

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);

tmacgbay avatar Mar 12 '20 20:03 tmacgbay

https works using these changes but viewing logs via websocket doesn't work

dhop90 avatar Apr 08 '20 02:04 dhop90

Huh. Let me know if you figure that one out - no time to focus on it at the moment.

tmacgbay avatar Apr 29 '20 19:04 tmacgbay