[https] client side https

delilah·2021년 4월 14일
0

Auth

목록 보기
3/3

goal


  • https 연결하기

ubuntu 기준입니다

1. Install Certutil

As a prerequisite, you are required to install certutil, a command-line utility that can create and modify certificate and key databases before you can install mkcert utility.

$ sudo apt install libnss3-tools -y

2. Install mkcert

Once the installation of certutil is done, download the mkcert binary from Github and install it as shown below

$ wget https://github.com/FiloSottile/mkcert/releases/download/v1.1.2/mkcert-v1.1.2-linux-amd64

$ mv mkcert-v1.1.2-linux-amd64 mkcert

$ chmod +x mkcert

$ sudo cp mkcert /usr/local/bin/

Generate Local CA

Now that the mkcert utility is installed, run the command below to generate your local CA.

$ mkcert -install
Then, You can see below
Using the local CA at "/home/jungeundelilahlee/.local/share/mkcert" ✨

Create .cert directory

$ mkdir -p .cert

Push cert.pem & key.pem in .cert directory

.root > .cert > cert.pem/key.pem

Update package.json file

"scripts": {
    "start":  "HTTPS=true SSL_CRT_FILE=./.cert/cert.pem SSL_KEY_FILE=./.cert/key.pem react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },

Restart npm start

npm start
Then, you can see https secure website now!

profile
delilah's journey

관심 있을 만한 포스트

0개의 댓글