Code Monkey home page Code Monkey logo

autocreate-ca's Introduction

autocreate-ca

Autocreate cetificate authority, detail in Chinese.

Usage

Download shell:

git clone https://github.com/barretlee/autocreate-ca.git;
cd autocreate-ca;
chmod +x *.sh;

Defatult install path: /root/ca, you can replace it in the files below.

sh ./install-rootCA.sh
sh ./install-intermediateCA.sh
# fg. www.barretlee.com 
sh ./install-websiteConfig.sh

check

Dblclick /root/ca/intermediate/certs/ca-chain.cert.pem and install the certs.

Add one line to /etc/hostswww.barretlee.com is the Common Name setted in file install-websiteConfig.sh, you can change it.

127.0.0.1 www.barretlee.com

Then run the code below:

// https-server.js
var https = require('https');
var fs = require('fs');

var options = {
  key: fs.readFileSync('/root/ca/intermediate/private/www.barretlee.com.key.pem'),
  cert: fs.readFileSync('/root/ca/intermediate/certs/www.barretlee.com.cert.pem'),
  passphrase: 'passoword' // 如果生成证书的时候设置了密码,请添加改参数和密码
};

https.createServer(options, function(req, res) {
  res.writeHead(200);
  res.end('hello world');
}).listen(8000, function(){
  console.log('Open URL: https://www.barretlee.com:8000');
});

And you will see:

The detail of cert:

LICENSE & Thanks

MIT.

Thanks for https://jamielinux.com/docs/openssl-certificate-authority/index.html.

autocreate-ca's People

Contributors

barretlee 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.