Created
March 7, 2022 12:23
-
-
Save yitsushi/2cd4ec3158c2f334d07f493da7f829e0 to your computer and use it in GitHub Desktop.
Generate CA with ssl keys
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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