简体   繁体   English

SslStream AuthenticateAsServer失败,并在Mono上出现“服务器证书私钥不可用。”异常

[英]SslStream AuthenticateAsServer failed with “Server certificate Private Key unavailable.” exception on Mono

Basically what I want to do is run the MSDN example about SslStream on Mono. 基本上我想做的是在Mono上运行有关SslStream的MSDN示例。

I keep getting the exception: Exception: The authentication or decryption has failed. 我不断收到异常: 异常:身份验证或解密失败。 Inner exception: Server certificate Private Key unavailable. 内部例外:服务器证书专用密钥不可用。

I assume the code should be fine, and that my problem is certificate/environment related. 我认为代码应该没问题,并且我的问题与证书/环境有关。

I have tried generating self-singed-certificates with both the OpenSsl toolkit and makecert. 我尝试使用OpenSsl工具包和makecert生成自认证证书。 I have also installed those certificates with certmgr in the Trust strof off both the user and the machine. 我还在用户和计算机上的Trust strof中使用certmgr安装了这些证书。

I am out of ideas and have no further clue. 我没有主意,也没有任何线索。 Anyone? 任何人? A step-by-step tutorial would be nice, but anything will be appreciated. 循序渐进的教程将是不错的,但是任何事情都将不胜感激。

Actually I found a solution that was suggested in this answer . 实际上,我找到了此答案中建议的解决方案。

  1. Use the X509Certificate 2 class instead of X509Certificate 使用X509Certificate 2类代替X509Certificate
  2. Embed the private key in the certificate (make a .pfx file) 将私钥嵌入证书中(创建一个.pfx文件)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 SslStream.AuthenticateAsServer异常-服务器模式SSL必须使用带有关联私钥的证书 - SslStream.AuthenticateAsServer exception - The server mode SSL must use a certificate with the associated private key SslStream.AuthenticateAsServer 抛出服务器模式 SSL 必须使用具有关联私钥的证书 - SslStream.AuthenticateAsServer throws The server mode SSL must use a certificate with the associated private key SslStream.AuthenticateAsServer证书链 - SslStream.AuthenticateAsServer certificate chain 如何在SSLStream的AuthenticateAsServer()中提供证书链? - How to provide certificate chain in SSLStream's AuthenticateAsServer()? 如何为SslStream.AuthenticateAsServer()创建证书? - How to create certificate for SslStream.AuthenticateAsServer()? 如何在不导入的情况下创建与 SslStream AuthenticateAsServer 一起使用的证书 - How to create a certificate to use with SslStream AuthenticateAsServer without importing 如何将 SslStream/AuthenticateAsServer 与自签名证书/密钥一起使用? - How can I use SslStream/AuthenticateAsServer with a self signed cert/key? SslStream.AuthenticateAsServer 挂起 - SslStream.AuthenticateAsServer hangs 具有可选ClientCertificate的SslStream AuthenticateAsServer - SslStream AuthenticateAsServer with optional ClientCertificate 在 C# 中,在服务器端使用 SslStream.AuthenticateAsServer() 有什么意义? - In C# what is the point of using SslStream.AuthenticateAsServer() on the server side?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM