Coder Social home page Coder Social logo

local-trust-chain's Introduction

Local Trust Chain

DO NOT USE THIS IN PRODUCTION (it's not tested at all at the moment and it aim's development only - so security isn't a priority)!

Anyway. This is a small script generating a local certificate with the current local ip of your device as subjectAltName - signed by a local "root" certificate. Useful if you need a valid SSL-Certificate for your development-machine but have to access it from another machine. Having this in mind, the "root" certificate is saved on disk and thus can be added to your keychains.

Usage

const LocalTrustChain = require('local-trust-chain');

const ltcOptions = {};

module.exports = {
    devServer: {
        open: true,
        https: LocalTrustChain(ltcOptions),
    },
}

Options

These are all options with their default value.

const options = {
    // Path where root-certificate is stored.
    path: '~/.local-trust-chain/'
    // settings for the "root" certificate aka certificate authorization
    ca: {
        // the filename without extension
        filename: 'local-ca',
        // key can be either 2048 or 4096
        keySize: 2048,
        // duration of validity in days
        validity: 730,
        // should the root cert be written to disc
        saveToDisc: true,
        // optional the private key can be stored with a passphrase
        passphrase: undefined,
    }
    cert: {
        // key can be either 2048 or 4096
        keySize: 2048,
        // duration of validity in days
        validity: 730,
    }
};

ToDos

  • ability to define a root certificate (making your local "root" an intermediate certificate)
  • option for writing certificate to disc
  • write tests
  • check passed options

local-trust-chain's People

Contributors

emm-ess avatar semantic-release-bot avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.