X509Certificate2 the server mode SSL must use a certificate with the associated private key

前端 未结 1 1477
悲&欢浪女
悲&欢浪女 2021-01-14 02:41

I use SslStream to build a web server. However, the code below throws an exception when AuthenticateAsServer.

static X509Certificate cert;
protected virtual         


        
相关标签:
1条回答
  • 2021-01-14 02:50
    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");
    
    0 讨论(0)
提交回复
热议问题