with openssl (≥ 1.1.1) I use:
openssl req -x509 -newkey rsa:4096 -sha256 -days 365 -nodes -set_serial 0 -keyout cert_name.key -out cert_name.crt -subj "/C=so