简体   繁体   English

服务器未使用TLS 1.2响应WebClient

[英]server not responding to WebClient using TLS 1.2

Although I specific to use TLS 1.2 still server is rejecting the connection. 尽管我专门使用TLS 1.2,但服务器仍拒绝连接。

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

Error: The remote server returned an error: (403) Forbidden. 错误:远程服务器返回错误:(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.

相关问题 使用TLS 1.2将客户端连接到TCP服务器 - Connecting a client to a TCP server using TLS 1.2 无法使用WebClient.DownloadFile方法从启用了TLS 1.1 / 1.2协议的计算机下载文件 - Can't download files from the computer with enabled TLS 1.1/1.2 protocols using WebClient.DownloadFile method MQTTnet TLS 1.2 加密服务器 - MQTTnet TLS 1.2 Encrypted Server C# 无法在 Windows 7/Windows Server 上使用 TLS1.2 创建 ssl/tls 安全通道 - C# Could not create ssl/tls secure channel on Windows 7/Windows Server, using TLS1.2 SQL 服务器 TLS 1.2 通信真的加密了吗? - SQL Server TLS 1.2 communication really encrypted? 将TLS 1.2与C#.Net Winform App和SQL Server 2008一起使用 - Using TLS 1.2 with C#.Net Winform App and SQL Server 2008 在Windows Server 2008 R2上使用IIS7.5使用TLS1.2发出请求 - make a request with TLS1.2 using IIS7.5 on Windows Server 2008 R2 使用HttpClient和HttpWebRequest来获取Https TLS1.2 - Using HttpClient & HttpWebRequest for Https TLS1.2 如何使用C#勾选“TLS 1.2”(Internet选项>高级设置>安全性> TLS 1.2) - How to tick “TLS 1.2”(Internet Option > Advanced setting > Security> TLS 1.2) using C# 如何使用 .NET 中的 1.2 TLS 版本获得 EWS 服务器的身份验证 - How to use 1.2 TLS version in .NET for getting authenticated to EWS Server
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM