2024-05-08 16:33:43 +05:00
|
|
|
#!/usr/bin/fish
|
|
|
|
|
2024-10-15 13:40:59 +05:00
|
|
|
set dist_name "/C=US/ST=No/L=No/O=self-cert/CN=self-cert"
|
|
|
|
envsubst <local_cert.cnf.base >local_cert.cnf
|
2024-05-08 16:33:43 +05:00
|
|
|
|
2024-10-15 13:40:59 +05:00
|
|
|
openssl req -x509 -nodes -newkey RSA:2048 -keyout self_ca.key -days 999 -out self_ca.crt -subj $dist_name
|
2024-05-08 16:33:43 +05:00
|
|
|
|
2024-10-15 13:40:59 +05:00
|
|
|
openssl req -nodes -newkey RSA:2048 -keyout local.key -out local.csr -subj $dist_name
|
|
|
|
openssl x509 -req -CA self_ca.crt -CAkey self_ca.key -in local.csr -out local.crt -days 999 -CAcreateserial -extfile local_cert.cnf
|
2024-05-08 16:33:43 +05:00
|
|
|
|
2024-10-15 13:40:59 +05:00
|
|
|
rm local.csr local_cert.cnf self_ca.key self_ca.srl
|