Avatar ·

خطأ "The request was aborted: Could not create SSL/TLS secure channel" أثناء طلب HTTPS

مرحبًا أيها الزملاء! أنا أكتب تطبيقًا بسيطًا لوحدة التحكم بلغة C# يجب أن يرسل طلب GET إلى API خارجي عبر HTTPS. أستخدم HttpWebRequest القديم الجيد. ولكن عند تنفيذ الطلب، يظهر استثناء باستمرار: "The request was aborted: Could not create SSL/TLS secure channel".\n\nهذا هو الكود الخاص بي:\n\n```csharp\nusing System;\nusing System.Net;\nusing System.IO;\n\nclass Program\n{\n static void Main()\n {\n string url = "https://some-secure-api.com/data";\n HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);\n request.Method = "GET";\n \n try\n {\n HttpWebResponse response = (HttpWebResponse)request.GetResponse();\n using (StreamReader reader = new StreamReader(response.GetResponseStream()))\n