2022-06-29 16:17:02 +00:00
|
|
|
#!/bin/bash
|
2023-03-28 05:36:30 +00:00
|
|
|
set -euo pipefail
|
2022-06-29 16:17:02 +00:00
|
|
|
|
|
|
|
cd "$(dirname "${BASH_SOURCE[0]}")"
|
|
|
|
|
2023-03-26 19:35:33 +00:00
|
|
|
# Generate a new RSA key/cert for local development
|
|
|
|
HOST="localhost"
|
|
|
|
CRT="$HOST.crt"
|
|
|
|
KEY="$HOST.key"
|
|
|
|
|
|
|
|
# Install the system certificate if it's not already
|
2023-03-28 05:36:30 +00:00
|
|
|
# NOTE: The ecdsa flag does nothing but I wish it did
|
|
|
|
go run filippo.io/mkcert -ecdsa -install
|
2023-03-26 19:35:33 +00:00
|
|
|
|
|
|
|
# Generate a new certificate for localhost
|
2023-03-28 05:36:30 +00:00
|
|
|
# This fork of mkcert supports the -days flag.
|
2023-05-25 00:20:44 +00:00
|
|
|
# TODO remove the -days flag when Chrome accepts self-signed certs.
|
2023-03-28 05:36:30 +00:00
|
|
|
go run filippo.io/mkcert -ecdsa -days 10 -cert-file "$CRT" -key-file "$KEY" localhost 127.0.0.1 ::1
|