Generating self-signed certificates
Tested on: Ubuntu 22.04
At first, let’s set environment variables
DOMAIN=mongodb
SUBJ="/CN=Local trust issuer"
# format:
# SUBJ="/C=RU/ST=someobl/L=somecity/O=somecompany/CN=$DOMAIN"Get a Certificate Authority certificate
openssl genrsa -out rootCA.key 4096
openssl req -x509 -new -nodes -key rootCA.key \
-sha256 -days 1024 -subj "$SUBJ" -out rootCA.pemNow we have public and private keys: rootCA.key and rootCA.pem. Let’s get information about our root Certificate Authority certificate: