If you need for test purpose to generate a self-signed certificate you can use the following procedure.
Download the following ini file, changing IP address and hostname
Run the following openSSL command
openssl req -x509 -newkey rsa:4096 -keyout $d/nginx.key -out $d/nginx.crt -days 3650 -nodes -config $d/cert.ini;