
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
loopback-ssl
Advanced tools
Node module to enable HTTPS/SSL in a loopback application with simple configurations. The module in addition enables trusted peer authentication.
Node module to enable HTTPS/SSL in a loopback application with simple configurations. The module also enables trusted peer authentication.
slc loopback <app-name>
cd <app-name>
npm install loopback-ssl --save
Add the following lines of configuration in 'config.json' in location "<app-dir>/server/config.json"
"httpMode": false,
"certConfig": {
"path": "/certificate/path/",
"key": "local.pem",
"cert": "local.crt.pem",
"ca": [],
"requestCert": false,
"rejectUnauthorized": false
}
Edit the server.js located at "<app-dir>/server/server.js"
Add the following line at the top of the code.
var loopbackSSL = require('loopback-ssl');
Replace the all the content within the code block starting with
app.start = function() { ... }
boot(app, __dirname, function(err) { ... });
with following code
boot(app, __dirname, function(err) {
if (err) throw err;
});
return loopbackSSL.startServer(app);
For example, the bare minimum server.js should look like
var loopback = require('loopback');
var boot = require('loopback-boot');
var loopbackSSL = require('loopback-ssl');
var app = module.exports = loopback();
boot(app, __dirname, function(err) {
if (err) throw err;
});
return loopbackSSL.startServer(app);
The configuration entry "httpMode": true
will enable http (disable https). In this mode the "certConfig": {..}
configuration is not required and can be omitted.
"httpMode": true
The configuration entry "httpMode": false
will enable https.
"httpMode": false,
"certConfig": {
"path": "/certificate/path/",
"key": "serverkey.pem",
"cert": "server-certificate.pem",
"ca": [],
"requestCert": false,
"rejectUnauthorized": false
}
"path"
- folder location where the certificates files will be installed"key"
- server key"cert"
- server certificate "httpMode": false,
"certConfig": {
"path": "/certificate/path/",
"key": "serverkey.pem",
"cert": "server-certificate.pem",
"ca": [
"client-certificate-to-validate.pem"
],
"requestCert": true,
"rejectUnauthorized": true
}
ca[]
configuration contains the list of client certificates which the server will authenticate"requestCert": true
enables mutual SSL authentication"rejectUnauthorized": true
enables the authenticity and validity check of client keys"rejectUnauthorized":
can be set to false
.MIT.
FAQs
Node module to enable HTTPS/SSL in a loopback application with simple configurations. The module in addition enables trusted peer authentication.
The npm package loopback-ssl receives a total of 78 weekly downloads. As such, loopback-ssl popularity was classified as not popular.
We found that loopback-ssl demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.