Another easy way to generate a self signed certificate is to use Jexus Manager,

- Choose a server node in the Connections panel.
- In the middle panel, click Server Certificates icon to open the management page.
- Under Actions panel, click “Generate Self-Signed Certificate...” menu item.
https://www.jexusmanager.com/en/latest/tutorials/self-signed.html