加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c# – RestSharp:无法创建SSL / TLS安全通道

发布时间:2020-12-16 01:57:22 所属栏目:百科 来源:网络整理
导读:我正在尝试在全新安装的 Windows 8.1中使用Visual Studio 2012 Express中的RestSharp.我试图使用的API仅支持RC4-SHA用于SSL.证书有效. var client = new RestClient();client.BaseUrl = "https://teststore.mybigcommerce.com/api/v2/";client.Authenticator
我正在尝试在全新安装的 Windows 8.1中使用Visual Studio 2012 Express中的RestSharp.我试图使用的API仅支持RC4-SHA用于SSL.证书有效.

var client = new RestClient();
client.BaseUrl = "https://teststore.mybigcommerce.com/api/v2/";
client.Authenticator = new HttpBasicAuthenticator("username","key");

var request = new RestRequest();
request.Resource = "time.json";

IRestResponse response = client.Execute(bcrequest);

我不断从客户端收到错误:请求已中止:无法创建SSL / TLS安全通道.我认为有证书问题,直到我最终采取数据包捕获并发现没有共同的密码套件. RC4-SHA在客户端不可用.安装Windows 7并运行完全相同的代码后,问题就消失了.

为什么在Windows 8.1上的RestSharp中RC4-SHA不可用?

解决方法

在我确认Win 8.1之后,我有一个应用程序失败的tls握手.我的Wireshark捕获工作和非工作客户端登录显示缺少密码套件.在我连接的服务器上安装真实证书也解决了这个问题.服务器有自签名证书.

我终于找到了this Microsoft article:

RC4 is no longer enabled by default for TLS. Applications (such as
Internet Explorer) might fail to connect if they depend on RC4

You can enable RC4 support by configuring these registry keys with the
following REG command:

[HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSecurityProvidersSCHANNELCiphers]

[HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSecurityProvidersSCHANNELCiphersRC4
128/128]"Enabled"=dword:ffffffff

[HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSecurityProvidersSCHANNELCiphersRC4
40/128]"Enabled"=dword:ffffffff

[HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSecurityProvidersSCHANNELCiphersRC4 56/128]"Enabled"=dword:ffffffff

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读