I use SslStream to build a web server. However, the code below throws an exception when AuthenticateAsServer.
static X509Certificate cert; protected virtual
makecert.exe -r -pe -n "CN=localhost" -sky exchange -sv server.pvk server.cer pvk2pfx -pvk server.pvk -spc server.cer -pfx server.pfx -pi <password> var certificate = new X509Certificate("path\server.pfx", "password");