繁体   English   中英

服务器未使用TLS 1.2响应WebClient

[英]server not responding to WebClient using TLS 1.2

尽管我专门使用TLS 1.2,但服务器仍拒绝连接。

我的代码在这里: https ://dotnetfiddle.net/zcVum2

错误:远程服务器返回错误:(403)禁止。

using (WebClient wc = new WebClient())
            {
            ServicePointManager.Expect100Continue = true;
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
            string url = "https://www.converse.com";
            wc.CachePolicy = new System.Net.Cache.RequestCachePolicy(System.Net.Cache.RequestCacheLevel.BypassCache);
            wc.Headers.Add("Cache-Control", "no-cache");
            wc.Encoding = Encoding.UTF8;
            string result = wc.DownloadString(url);
        }

我可以通过更改为.net core来解决此问题,即使不需要SSL配置

暂无
暂无

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM