@echo off
REM USER SETTINGS
REM
REM SERVER_HOSTNAME
REM
REM Set the DNS HOSTNAME or IP of the machine gst3-server runs on.
REM
REM For example: SERVER_HOSTNAME=GST3_SERVER
REM or: SERVER_HOSTNAME=192.168.0.104
REM
SET SERVER_HOSTNAME=
REM
REM END USER SETTINGS
REM
REM Note: If you want to use your own OPENSSL, change OPENSSL_BIN_PATH below.
SET OPENSSL_BIN_PATH=.
SET OPENSSL_CONF=%OPENSSL_BIN_PATH%\openssl.cfg
%OPENSSL_BIN_PATH%\openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -subj "/CN=%SERVER_HOSTNAME%" -nodes
%OPENSSL_BIN_PATH%\openssl pkcs12 -export -inkey key.pem -in cert.pem -out gst3.pkcs12
%OPENSSL_BIN_PATH%\openssl x509 -inform PEM -in cert.pem -outform DER -out gst3.der
DEL /q key.pem cert.pem .rnd
