Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
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.
# install loopback-cli
npm install -g loopback-cli
# create project directory
mkdir <app-name>
cd <app-name>
# create loopback application
lb
# ? What's the name of your application? <app-name>
# ? Which version of LoopBack would you like to use? 3.x (current)
# ? What kind of application do you have in mind? notes
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". Replace the code in server.js with the code below (assuming no prior customizations to the file)
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 certificateWill only work with pre-generated certificate files
"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.
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.
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.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.