readytowork-org
Published in

readytowork-org

Enable SSL for local development

This document will guide you through the running application on HTTPS mode for local development.

Environment: Mac OS / Unix

This uses the npm package which redirects HTTPS to our HTTP running app. Install the following npm package globally.

GitHub — cameronhunter/local-ssl-proxy: Simple SSL HTTP proxy using a self-signed certificate. Intended for local development only.

Simple SSL HTTP proxy using a self-signed certificate. They are intended for local development only.

npm install -g local-ssl-proxy

After installation use

local-ssl-proxy --source 9001 --target 9000

Here target port is our running application port and source for HTTPS enabled port.

Setup hostname for domain

  1. sudo nano /etc/hosts
  2. Add the following to let our domain redirect to our local server.

127.0.0.1 xxxproject.local

Run SSL proxy with a self-signed trusted certificate for xxxproject.local

We can use it to hostname xxxproject.local, and wildcards are also supported.

  1. Install mkcert (choco install mkcert / brew install mkcert)
  2. Run mkcert -install
  3. Run mkcert xxxproject.local
  4. Run

local-ssl-proxy --key xxxproject.local-key.pem --cert xxxproject.local.pem --source 9001 --target 9000

We should run our project under port 9000 (target port is our application port) whereas 9001 (SSL enabled port for the application)

You’re all set! Just go to https://xxxproject.local:9001 and see your project working!

--

--

--

Technology enthusiast

Recommended from Medium

Test Annotations — Part 1

Writing a scanner to find reflected XSS vulnerabilities — Part 2

What does a Front End developer do?

What does a Front End developer do

Five tips for describing what you do as a tester

Creating a Python API Wrapper (Ally Invest API)

Striving to continuously delivering quality

Stock Market Analysis (By S&P 500 Index) Using Python

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Prajwol KC

Prajwol KC

More from Medium

Microservices vs API

One-minute Solution for Front-end and Back-end Joint Debugging Problems

Feeds Fetcher — Drupal

Zabbix Upgrade 5.0 to 6.0 using CentOs 8