nuoxoxo / cc5

Full Fathom Five - [ IRC - Module 9 - Inception - Containers ]
0 stars 0 forks source link

Lemp Inc. #2

Closed nuoxoxo closed 1 year ago

nuoxoxo commented 1 year ago
nuoxoxo commented 1 year ago

Get HTTPS working on local environment

Solution

$ 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

Step 2: Trust the root SSL certificate

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.

Step 3: Domain SSL certificate

[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