host_fqdn=$( hostname --long )
cert_c="<Country Name>" # Country Name (C, 2 letter code)
cert_s="<State>" # Certificate State (S)
cert_l="<Locality>" # Certificate Locality (L)
cert_o="<Organization>" # Certificate Organization (O)
cert_ou="<Org Unit>" # Certificate Organizational Unit (OU)
cert_cn="${host_fqdn}" # Certificate Common Name (CN)
openssl req \
-newkey rsa:4096 \
-nodes \
-sha256 \
-keyout /opt/registry/certs/domain.key \
-x509 \
-days 365 \
-out /opt/registry/certs/domain.crt \
-addext "subjectAltName = DNS:${host_fqdn}" \
-subj "/C=${cert_c}/ST=${cert_s}/L=${cert_l}/O=${cert_o}/OU=${cert_ou}/CN=${cert_cn}"
$ host_fqdn = $( hostname --long )
$ cert_c = "<Country Name>"
$ cert_s = "<State>"
$ cert_l = "<Locality>"
$ cert_o = "<Organization>"
$ cert_ou = "<Org Unit>"
$ cert_cn = "${host_fqdn} "
$ openssl req \
-newkey rsa:4096 \
-nodes \
-sha256 \
-keyout /opt/registry/certs/domain.key \
-x509 \
-days 365 \
-out /opt/registry/certs/domain.crt \
-addext "subjectAltName = DNS:${host_fqdn} " \
-subj "/C=${cert_c} /ST=${cert_s} /L=${cert_l} /O=${cert_o} /OU=${cert_ou} /CN=${cert_cn} "
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow