Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/visual-studio-2010/4.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# 获取错误107(网络::错误SSL协议错误):SSL协议错误_C#_Visual Studio 2010_Ssl_Windows Xp_Httpcfg.exe - Fatal编程技术网

C# 获取错误107(网络::错误SSL协议错误):SSL协议错误

C# 获取错误107(网络::错误SSL协议错误):SSL协议错误,c#,visual-studio-2010,ssl,windows-xp,httpcfg.exe,C#,Visual Studio 2010,Ssl,Windows Xp,Httpcfg.exe,我知道stackoverflow上有很多与相同主题相关的问题,但这里我有一些不同的问题: 我使用安装程序类在win7/Winxp上保留一个端口,并用哈希绑定它: if (Environment.OSVersion.Version.Major > 5) { startInfo.Arguments = @"/c netsh http add urlacl url=https://127.0.0.1:8083/ user=EVERYONE"; netsh http add ssl

我知道stackoverflow上有很多与相同主题相关的问题,但这里我有一些不同的问题:

我使用
安装程序类
win7/Winxp
保留一个端口
,并
用哈希绑定它:

if (Environment.OSVersion.Version.Major > 5)
{
    startInfo.Arguments = @"/c netsh http add urlacl url=https://127.0.0.1:8083/ user=EVERYONE";
    netsh http add sslcert ipport=127.0.0.1:8083 certhash=df03c4b0b32f3302a3b70abe6b5dfd864d0986a5 appid={00112233-4455-6677-8899-CCBBCCDDEEFF} clientcertnegotiation=enable;
}
else
{
    startInfo.Arguments = @"/c httpcfg set urlacl /u https://127.0.0.1:8083/";
    httpcfg set ssl -i 127.0.0.1:8083 -h df03c4b0b32f3302a3b70abe6b5dfd864d0986a5 -f 2
}
代码和设置项目没有问题。除以下几点外,一切正常:

  • 每当我在
    win7
    上安装
    exe
    时,它都会成功运行
    WCF
    webservice
  • 每当我在本地计算机上使用
    WinXP(SP#)
    时,它会抛出一个错误:

    错误107(网络::错误SSL协议错误):SSL协议错误

  • 但是,当我使用teamviewer登录任何
    WinXp
    虚拟机时,它会成功运行

怎么可能呢,我试了好几次,结果都一样。它在Xp(在VM上运行)上运行,但不是在真正的Xp机器上运行

我在绑定和保留端口时写了什么错误吗?防火墙在这里起作用吗

我还用
httpcfg query ssl
确认了它,并且哈希已成功绑定到端口

任何帮助都是值得的

IMO此命令不起作用:
netsh http add urlacl url=https://127.0.0.1:8083/ 用户=所有人

我试图用
fiddler
找出错误,它说:

"Failed to secure existing conection for <ipaddress>.  Authentication failed because the remote party has closed the transport stream."
“无法保护的现有连接。身份验证失败,因为远程方已关闭传输流。”

本地XP机器的配置可能与虚拟机器的配置不同。我能想到的一种情况是,IT部门会以一种方式配置XP机器,然后您自己创建一个虚拟机,它只是使用默认设置(不同)。我并不是说这是你的特定场景,只是一个场景。另一个原因是机器过时/未更新,这与其说是配置问题,不如说是存在bug

无论如何,我要说的是,一个虚拟机不具备的特征。你对防火墙设置的评论也可能是准确的——试试谷歌


祝你好运

这可能看起来很愚蠢,但有些应用程序可以使用SSL端口,如Team Viewer甚至Skype。尝试关闭此应用程序,以防您的计算机上运行某些应用程序


抱歉,这只是一个猜测:)但我希望它能帮助…

在调用您的WCF服务时执行以下设置

ServicePointManager.ServerCertificateValidationCallback =
            delegate(object s, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { return true; };
有关更多详细信息,请参阅: