Giter VIP home page Giter VIP logo

generate-self-signed-certificate's Introduction

Generate self-signed HTTPS/SSL cert

Satisfy Chromium/Chrome 58+ strict requirements for self-signed HTTPS/SSL cert. It resolve all errors such as ๐Ÿ‘‡

Subject Alternative Name Missing.
This site is missing a valid, trusted certificate (net::ERR_CERT_COMMON_NAME_INVALID).
This site is missing a valid, trusted certificate (net::ERR_CERT_AUTHORITY_INVALID).
...

Step 1

Create CA key and cert

$ sh ./create_root_CA_key_and_cert.sh

Step 2

Create server/domain key

$ sh ./create_certificate_for_domain.sh {your.domain}

Step 3

Add cert and key to Apache2/Nginx/... site-file, HTTPS (port 443) section. Cert files is located at certs directory.

SSLCertificateFile    /path_to_your_files/your.domain.crt
SSLCertificateKeyFile /path_to_your_files/your.domain.key

Or with nodejs/express:

const key = fs.readFileSync(your.domain.key);
const cert = fs.readFileSync(your.domain.cert);
const ca = fs.readFileSync(rootCA.pem);
const credentials = { key, cert, ca };
const app = express();
const server = https.createServer(credentials, app);
server.listen(port, host, function() {
    console.log(`Server on https://${host}:${port}`);
});

Step 4

Add cert to the browser

Chromium -> Setting -> (Advanced) Manage Certificates -> Import -> 'rootCA/rootCA.pem'

generate-self-signed-certificate's People

Contributors

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