#!/bin/bash
#
# YACHT (Yet Another CA How To) Placed in public domain. RLamb 2019
#
if [ $# -lt 1 ]; then
  echo "Usage $0 www"
  exit 0
fi
#export SAN="DNS:$1,DNS:value2"
export SAN="DNS:$1"
openssl ecparam -out ecparam.pem -name prime256v1
openssl req -config req.cnf -new -newkey ec:ecparam.pem -nodes -keyout new.key -out new.csr -subj "/CN=$1/OU=Example SSL/O=Example Inc./street=1 Main St/street=Suite 100/L=Ballarat/ST=California/postalCode=93592/C=US/businessCategory=Private Organization/jurisdictionST=California/jurisdictionC=US/serialNumber=92011805"
