Closed nuoxoxo closed 1 year ago
# generate a RSA-2048 key and save it in rootCA.key
$ openssl genrsa -des3 -out rootCA.key 2048
- This file will be used as the key to generate the Root SSL certificate.
- You will be prompted for a pass phrase each time you use this key to generate a certificate.
```sh
# create a Root SSL certificate in _.pem, valid for 1024 days
openssl req \
-x509 -new -nodes -key rootCA.key \
-sha256 -days 1024 -out rootCA.pem
Before you can use the newly created Root SSL certificate to start issuing domain certificates, there’s one more step. You need to to tell your Mac to trust your root certificate so all individual certificates issued by it are also trusted.
server.csr.cnf
and in it write
[req]
default_bits = 2048
prompt = no
default_md = sha256
distinguished_name = dn
[dn] C=US ST=RandomState L=RandomCity O=RandomOrganization OU=RandomOrganizationUnit emailAddress=hello@example.com CN = localhost
- Create <kbd> v3.ext </kbd> file in order to create a <kbd> X509 v3 certificate </kbd>
```sh
authorityKeyIdentifier=keyid,issuer
basicConstraints=CA:FALSE
keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment
subjectAltName = @alt_names
[alt_names]
DNS.1 = localhost
openssl req -new -sha256 -nodes -out server.csr -newkey rsa:2048 -keyout server.key -config <( cat server.csr.cnf )
openssl x509 -req -in server.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial -out server.crt -days 500 -sha256 -extfile v3.ext
docker & misc.
localhost:8080
8000
by default