sách gpt4 ăn đã đi

c# - 请求被中止 : Could not create SSL/TLS secure channel

In lại 作者:IT王子 更新时间:2023-10-29 03:47:07 25 4
mua khóa gpt4 giày nike

我的客户已告知我他们的 SSL 和 Internet Explorer 存在问题。他们说他们在访问 URL 时遇到信任问题。

我正在通过 HTTPS 访问 JSON。该网站位于一台服务器上,我在本地计算机上使用控制台应用程序。我试图绕过 SSL 证书,但是,我的代码仍然失败。

我可以修改 HttpWebRequest 来解决这个问题吗?

我在使用这段代码时遇到了这个错误:

    // You must change the URL to point to your Web server.
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
req.Method = "GET";
req.AllowAutoRedirect = true;

// allows for validation of SSL conversations
ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };


WebResponse respon = req.GetResponse();
Stream res = respon.GetResponseStream();

string ret = "";
byte[] buffer = new byte[1048];
int read = 0;
while ((read = res.Read(buffer, 0, buffer.Length)) > 0)
{
//Console.Write(Encoding.ASCII.GetString(buffer, 0, read));
ret += Encoding.ASCII.GetString(buffer, 0, read);
}
return ret;

câu trả lời hay nhất

我必须启用其他安全协议(protocol)版本才能解决问题:

    ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls
| SecurityProtocolType.Tls11
| SecurityProtocolType.Tls12
| SecurityProtocolType.Ssl3;

关于c# - 请求被中止 : Could not create SSL/TLS secure channel,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10822509/

25 4 0
IT王子
Hồ sơ

Tôi là một lập trình viên xuất sắc, rất giỏi!

Nhận phiếu giảm giá taxi Didi miễn phí
Phiếu giảm giá taxi Didi
Chứng chỉ ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com
Xem sitemap của VNExpress