Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/296.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 为什么sslStream.server不需要UAC和其他选择_C#_.net_Ssl_Sslstream - Fatal编程技术网

C# 为什么sslStream.server不需要UAC和其他选择

C# 为什么sslStream.server不需要UAC和其他选择,c#,.net,ssl,sslstream,C#,.net,Ssl,Sslstream,在调整web代理代码时,我注意到,如果我在具有UAC用户访问控制的应用程序中运行代码,我会遇到一个异常 以下是引发异常的位置: sslStream.AuthenticateAsServer(_certificate, false, SslProtocols.Tls | SslProtocols.Ssl3 | SslProtocols.Ssl2, false); 这是我在UAC上遇到的错误 The server mode SSL must use a certificate with the a

在调整web代理代码时,我注意到,如果我在具有UAC用户访问控制的应用程序中运行代码,我会遇到一个异常

以下是引发异常的位置:

sslStream.AuthenticateAsServer(_certificate, false, SslProtocols.Tls | SslProtocols.Ssl3 | SslProtocols.Ssl2, false);
这是我在UAC上遇到的错误

The server mode SSL must use a certificate with the associated private key.
第一个问题:为什么


第二个问题:有其他选择吗?我真的很想在UAC中运行此功能。请注意,http工作正常

听起来您证书的私钥可能位于文件访问受限的位置。这是为了不只是任何用户都可以读取您的私钥。使用有限权限运行服务的目的是什么?如果密钥仅用于此服务,则可以考虑删除其所属文件夹中的安全限制,但是如果此密钥是针对整个域的,那么我会犹豫地这样做…

< p>您在适当的证书存储中安装了证书吗?


根据我在使用证书时的记忆,您加载的文件仅用作在其中一个Windows证书存储中标识服务器证书的引用。如果代理在一个帐户下运行,而不是在另一个帐户下运行,则可能您没有在另一个帐户的个人证书存储中安装证书。

否私钥位于当前脚本可以从O2 Platform scripts文件夹中读取的位置(在本例中为O2 Platform scripts文件夹),因此肯定还有其他内容。这是重复的吗?