Over the years I have often come across a moment or two when I needed to have self-signed certificate authority. Well, a few years ago I stumbled across this lovely tutorial and explanation by Jamie Nguyen. Please, use this, and all credit to Jamie.
https://jamielinux.com/docs/openssl-certificate-authority/