On Windows, self-signed certificates can be created by using the New-SelfSignedCertificate PowerShell cmdlet. For an unsupported example, see the UpdateIISExpressSSLForChrome.ps1 certificate file on GitHub.
On macOS, Linux, and Windows, create certificates can be created by using OpenSSL.