Skip to content

Instantly share code, notes, and snippets.

@yitsushi
Created March 7, 2022 12:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yitsushi/2cd4ec3158c2f334d07f493da7f829e0 to your computer and use it in GitHub Desktop.
Save yitsushi/2cd4ec3158c2f334d07f493da7f829e0 to your computer and use it in GitHub Desktop.
Generate CA with ssl keys
# 5 years
validDays:=1825
priv:
openssl req -new -sha256 -nodes -out server/server.csr -newkey rsa:2048 -keyout server/server.key -config server.csr.cnf
cert:
openssl x509 -req -in server/server.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial -out server/server.crt -days $(validDays) -sha256 -extfile v3.ext
_rootca:
openssl genrsa -des3 -out rootCA.key 2048
_rootcakey:
openssl req -x509 -new -nodes -key rootCA.key -sha256 -days 1460 -out rootCA.pem
authorityKeyIdentifier=keyid,issuer
basicConstraints=CA:FALSE
keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment
subjectAltName = @alt_names
[alt_names]
DNS.1=sub1.domain.tld
DNS.2=sub2.domain.tld
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment