Giter Site home page Giter Site logo

ssl-self-signed's Introduction

ssl-self-signed

Generate 100-year self-signed ssl certificates for your domain/IP.

Requested

Linux

OpenSSL

Install

npm install ssl-self-signed

Examples

var sss = require('ssl-self-signed');
// auto generate CA
sss({
  output: __dirname, 
  commonName: '192.168.56.101',
  end(){
    if(err){
      return console.error(err);
    }
    console.log('ok');
  }
});

Generate files:

  • CA.key CA's private key.
  • CA.crt Import into browser.
  • server.crtserver.key use for server.

opts

  • CA If not set(undefined): If under the ouput not have CA.key and CA.crt, It will generate CA. otherwise It will use CA.key and CA.crt under the ouput. default undefined.

    If is Object: It will use you provide'CA,

    • key CA's private key path.
    • cert CA's cert file path.
  • bit: default 2048

  • days: default 365 * 100

  • C: Country default "CN"

  • O: Organization default "AAA ssl-self-signed"

Use other CA:

var sss = require('ssl-self-signed');

sss({
  output: __dirname,
  commonName: '192.168.56.101',
  CA: {
    key: '/somePath/CA.key', //cmd path is output
    cert: '/somePath/CA.crt'
  },
  C: 'CN', // Must be the same as CA, otherwise will be get a unhandle error.
  O: 'AAA', // Must be the same as CA, otherwise will be get a unhandle error.
  end(err){
    if(err){
      return console.error(err);
    }
    console.log('ok');
  }
});

Import CA:

Import CA.crt into browsers(should put it into 'Trusted Root Certification Authorities' place). Some guide like: window-chrome-import-guide

Also need restart your browser.

ssl-self-signed's People

Contributors

hezedu avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

ssl-self-signed's Issues

does not create server.crt with assigned CA

When I run it without a CA object all files are created. Then I try to create the server certificates again with the created CA certs. The csr, key and the v3.ext are created but the CA.srl and server.crt are not.

If I run the serverCrtCmd command myself afterwards though on cmd, the files are created.

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.