Fork Copy REM PLEASE UPDATE THE FOLLOWING VARIABLES FOR YOUR NEEDS. @echo off set /p HOSTNAME="HOSTNAME: " @echo off set /p DOT="DOT: " REM SET HOSTNAME= "admin.learn" REM SET DOT=lien SET COUNTRY=US SET STATE=KS SET CITY=Olathe SET ORGANIZATION=IT SET ORGANIZATION_UNIT=IT Department SET EMAIL=dangdang0511@%HOSTNAME%.%DOT% ( echo [req] echo default_bits = 2048 echo prompt = no echo default_md = sha256 echo x509_extensions = v3_req echo distinguished_name = dn echo: echo [dn] echo C = %COUNTRY% echo ST = %STATE% echo L = %CITY% echo O = %ORGANIZATION% echo OU = %ORGANIZATION_UNIT% echo emailAddress = %EMAIL% echo CN = %HOSTNAME%.%DOT% echo: echo [v3_req] echo subjectAltName = @alt_names echo: echo [alt_names] ::echo DNS.1 = *.%HOSTNAME%.%DOT% echo DNS.2 = %HOSTNAME%.%DOT% )>%HOSTNAME%.%DOT%.cnf openssl req -new -x509 -newkey rsa:2048 -sha256 -nodes -keyout %HOSTNAME%.%DOT%.key -days 3560 -out %HOSTNAME%.%DOT%.crt -config %HOSTNAME%.%DOT%.cnf