Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
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 99 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
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.