mkcert
mkcert copied to clipboard
How to change publisher info
The default mkcert commad's cert info is:
Subject: /O=mkcert development certificate/OU=root@myosname
Issuer: mkcert root@myosname
How can i to chage the root@myosname info to www.myhost.com?
#!/bin/bash
# Define the desired CN for the root certificate
custom_cn="www.myhost.com"
# Install mkcert if not already installed
if ! command -v mkcert &> /dev/null; then
echo "mkcert is not installed. Installing..."
brew install mkcert # Assuming you have Homebrew on macOS
fi
mkcert -install
mkcert -key-file rootCA-key.pem -cert-file rootCA.pem "${custom_cn}"
domains=("www.myhost.com" "example.com" "anotherdomain.com")
for domain in "${domains[@]}"; do
mkcert -key-file "${domain}-key.pem" -cert-file "${domain}-cert.pem" "${domain}"
done
echo "Certificates generated successfully."