Generate a self-signed certificate: openssl req -x509 -sha256 -nodes -days 365 -newkey rsa:2048 -keyout privateKey.key -out certificate.crt Combine separate crt and key files in pfx: openssl pkcs12 -export -out certificate.pfx -inkey privateKey.key -in certificate.crt