Git Product home page Git Product logo

create-ssl-certificate's Introduction

create-ssl-certificate

Command line tool to create self signed SSL certificate

Based on the following amazing GIST.

NOTE!

  1. This only works on MAC!

  2. Requires Node version 8 or higher

Create

In the folder of your project use the NPM executer:

npx create-ssl-certificate

This will create a certificate for the domain: FOLDER_NAME.local and any subdomain.

Options

Hostname

npx create-ssl-certificate --hostname myproject

This will create a certificate for the domain: myproject.local and any subdomain.

Domain

npx create-ssl-certificate --hostname myproject --domain test

This will create a certificate for the domain: myproject.test and any subdomain.

Route to localhost

You choose either 1. or 2.

1. Simple setup

This setup only works for the specific hostname and no subdomains. Add the following, where you replace hostname and top level domin name to your own configuration:

127.0.0.1    myproject.local

to your /etc/hosts file.

2. Universal setup

You can do a "one time" setup, which works on all hostnames for the given top level domain, etc. .local. A good solution is dnsmasq. Install it via homebrew.

brew install dnsmasq

To make it start when your mac boots up:

brew services start dnsmasq

To route all top level domain lookups to localhost you will have to run these commands. Replace local in both echo commands if you chose a different top level domain.

mkdir -pv $(brew --prefix)/etc
sudo cp -v $(brew --prefix dnsmasq)/homebrew.mxcl.dnsmasq.plist /Library/LaunchDaemons
sudo launchctl load -w /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
sudo mkdir -pv /etc/resolver
echo "address=/.local/127.0.0.1" | sudo tee -a $(brew --prefix)/etc/dnsmasq.conf
echo "nameserver 127.0.0.1" | sudo tee /etc/resolver/local

You usually have to restart your computer for this to take proper effect.

create-ssl-certificate's People

Contributors

christianalfoni avatar mikaelbr avatar

Watchers

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