For a local test of HTTPS you do not need a certificate authority. A self-signed certificate takes one command, as long as you keep its limits in mind.
openssl req -x509 -newkey rsa:2048 -days 365 \
-subj "/CN=localhost" \
-addext "subjectAltName = DNS:localhost" \
-keyout key.pem -out cert.pem -noenc
-x509 outputs a self-signed certificate instead of a certificate request, which the manual says is typically used for test certificates. -newkey rsa:2048 generates the key, -keyout and -out name the files, and -subj saves you the interactive questions.
Set -days yourself. The manual gives 30 days as the default. The -addext line adds a subjectAltName, which matters because current browsers check the name there. -noenc leaves the private key unencrypted. It replaces -nodes, which is deprecated since OpenSSL 3.0, but on older versions you may still need -nodes.
The caveats are practical. Browsers will warn about this certificate, because no trusted authority signed it, and you have to accept the warning or import the certificate yourself. Anyone who gets key.pem can impersonate your test site, since the key has no passphrase. Never use a certificate like this in production. For a public site, a free certificate from Let’s Encrypt is the better route.
Further reading: OpenSSL: openssl-req