環境

  • Raspberry PI 3 Model B

インストール

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// libnss3-toolsインストール
pi3 ~$ sudo apt update
pi3 ~$ sudo apt install -y libnss3-tools

// mkcertインストール
pi3 ~$ wget -O mkcert https://github.com/FiloSottile/mkcert/releases/download/v1.4.1/mkcert-v1.4.1-linux-arm
pi3 ~$ chmod +x mkcert
pi3 ~$ sudo mv mkcert /usr/local/bin/

// 動作確認
pi3 ~$ mkcert --help
Usage of mkcert:

$ mkcert -install
Install the local CA in the system trust store.

$ mkcert example.org
Generate "example.org.pem" and "example.org-key.pem".

$ mkcert example.com myapp.dev localhost 127.0.0.1 ::1
Generate "example.com+4.pem" and "example.com+4-key.pem".

$ mkcert "*.example.it"
Generate "_wildcard.example.it.pem" and "_wildcard.example.it-key.pem".

$ mkcert -uninstall
Uninstall the local CA (but do not delete it).

使い方

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// 証明書作成
pi3 ~$ mkcert
Created a new local CA at "/home/pi/.local/share/mkcert" 💥
Warning: the local CA is not installed in the system trust store! ⚠️
Run "mkcert -install" to avoid verification errors ‼️
Usage of mkcert:

$ mkcert -install
Install the local CA in the system trust store.

$ mkcert example.org
Generate "example.org.pem" and "example.org-key.pem".

$ mkcert example.com myapp.dev localhost 127.0.0.1 ::1
Generate "example.com+4.pem" and "example.com+4-key.pem".

$ mkcert "*.example.it"
Generate "_wildcard.example.it.pem" and "_wildcard.example.it-key.pem".

$ mkcert -uninstall
Uninstall the local CA (but do not delete it).

For more options, run "mkcert -help".
1
2
3
4
// 証明書インストール
pi3 ~$ mkcert -install
Using the local CA at "/home/pi/.local/share/mkcert" ✨
The local CA is now installed in the system trust store! ⚡️
1
2
3
4
5
// 確認
pi3 ~$ tree ~/.local/share/mkcert/
/home/pi/.local/share/mkcert/
├── rootCA-key.pem
└── rootCA.pem