Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Certificate - www file modified for https #60

Open
tmacgbay opened this issue Mar 12, 2020 · 2 comments
Open

Certificate - www file modified for https #60

tmacgbay opened this issue Mar 12, 2020 · 2 comments

Comments

@tmacgbay
Copy link

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);
@dhop90
Copy link

dhop90 commented Apr 8, 2020

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

@tmacgbay
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants