Description
SSL Certificates using SNI with almost zero configuration for free with https://letsencrypt.org!
Auto SNI alternatives and similar modules
Based on the "Security" category.
Alternatively, view Auto SNI alternatives based on common mentions on social networks and blogs.
-
snyk
Snyk CLI scans and monitors your projects for security vulnerabilities. [Moved to: https://github.com/snyk/cli] -
rate-limiter-flexible
Count and limit requests by key with atomic increments in single process or distributed environment. -
Themis by Cossack Labs
Easy to use cryptographic framework for data protection: secure messaging with forward secrecy and secure data storage. Has unified APIs across 14 platforms. -
is-website-vulnerable
finds publicly known security vulnerabilities in a website's frontend JavaScript libraries -
crypto-hash
Tiny hashing module that uses the native crypto API in Node.js and the browser -
jose-simple
Jose-Simple allows the encryption and decryption of data using the JOSE (JSON Object Signing and Encryption) standard. -
GuardRails
GitHub app that provides security feedback in pull requests.
Appwrite - The Open Source Firebase alternative introduces iOS support
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of Auto SNI or a related project?
README
Auto SNI
SSL Certificates using SNI with almost zero configuration for free with https://letsencrypt.org!
If you have any questions, throw them up on gitter.
Installation
Npm
npm install auto-sni
Features
- Fetch SSL certificates from letsencrypt.
- Automatically renew certificates.
- Forward all incoming http requests to https.
Example
var createServer = require("auto-sni");
var server = createServer({
email: ..., // Emailed when certificates expire.
agreeTos: true, // Required for letsencrypt.
debug: true, // Add console messages and uses staging LetsEncrypt server. (Disable in production)
domains: ["mysite.com", ["test.com", "www.test.com"]], // List of accepted domain names. (You can use nested arrays to register bundles with LE).
dir: "~/letsencrypt/etc", // Directory for storing certificates. Defaults to "~/letsencrypt/etc" if not present.
ports: {
http: 80, // Optionally override the default http port.
https: 443 // // Optionally override the default https port.
}
});
// Server is a "https.createServer" instance.
server.once("listening", ()=> {
console.log("We are ready to go.");
});
Usage with express.
var createServer = require("auto-sni");
var express = require("express");
var app = express();
app.get("/test", ...);
createServer({ email: ..., domains: ..., agreeTos: true }, app);
Usage with koa.
var createServer = require("auto-sni");
var koa = require("koa");
var app = koa();
app.use(...);
createServer({ email: ..., domains: ..., agreeTos: true }, app.callback());
Usage with rill.
var createServer = require("auto-sni");
var rill = require("rill");
var app = rill();
app.get("/test", ...);
createServer({ email: ..., domains: ..., agreeTos: true }, app.handler());
Usage with hapi.
// Untested (Let me know in gitter if this doesn't work.)
var createServer = require("auto-sni");
var hapi = require("hapi");
var server = new hapi.Server();
var secureServer = createServer({ email: ..., domains: ..., agreeTos: true });
server.connection({ listener: secureServer, autoListen: false, tls: true });
Usage with restify.
// Untested (Let me know in gitter if this doesn't work.)
var createServer = require("auto-sni");
var restify = require("restify");
var app = restify.createServer({ name: 'myapp', version: '1.0.0' });
app.get("/test", ...);
createServer({ email: ..., domains: ..., agreeTos: true }, app.server);
Dynamic Domains
You can also specify an async function to approve domains like so:
createServer({
...,
domains: (options, cert, cb) => {
setTimeout(() => cb({ options, cert }), 1000)
}
})
Root Access
AutoSNI requires access to low level ports 80 (http) and 443 (https) to operate by default. These ports are typically restricted by the operating system.
In production (on linux servers) you can use the following command to give Node access to these ports.
sudo setcap cap_net_bind_service=+ep `readlink -f \`which node\``
For development it's best to set the "ports" option manually to something like:
{
ports: {
http: 3001,
https: 3002
}
}
// Access server on localhost:3002
Rate Limits
Currently LetsEncrypt imposes some rate limits on certificate creation. Click here for the current rate limits.
Contributions
Please use npm test
for tests and feel free to create a PR!