mac/dot-local/bin/sign-with-own-ca

8 lines
281 B
Text
Raw Permalink Normal View History

#!/bin/zsh
if ! [[ -r $1 ]]; then
print "Usage: $0 path/to/request.csr" >&2
exit 1
fi
ca=/etc/ssl/$HOST/root
sudo openssl x509 -req -CA $ca.crt -CAkey $ca.key -CAcreateserial -sha256 -days 30 -extensions v3_req -extfile /usr/local/etc/openssl/openssl.cnf -in $1 -out ${1:r}.crt