mkcert icon indicating copy to clipboard operation
mkcert copied to clipboard

How to change publisher info

Open lasyka opened this issue 5 years ago • 1 comments

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?

lasyka avatar Mar 17 '20 00:03 lasyka

#!/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."

ljluestc avatar Dec 29 '23 04:12 ljluestc