create simple SHA256 key + CSR
openssl req -nodes -newkey rsa:2048 -sha256 -keyout test.key -out test.csr
create key + CSR from config
openssl req -new -config test.conf -keyout test.key -out test.csr
config file example
[ req ]
default_bits = 2048
prompt = no
encrypt_key = no
default_md = sha256
distinguished_name = dn
[ dn ]
CN = subdomain.example.com
O = MyCompany
OU = oranizational unit
L = location
ST = state
C = country
config file example with SAN
[ req ]
default_bits = 2048
prompt = no
encrypt_key = no
default_md = sha256
req_extensions = req_ext
distinguished_name = dn
[ dn ]
CN = subdomain.example.com
O = MyCompany
OU = oranizational unit
L = location
ST = state
C = country
[ req_ext ]
subjectAltName = DNS: subdomain.example.com