Gösterim Stili İstek durduruldu: SSL/TLS güvenli kanalı oluşturulamadı.
"İstek durduruldu: SSL/TLS güvenli kanalı oluşturulamadı." hatası alırsanız yapmanız gereken bu yazıda :)
WebClient sınıfını kullanarak bir url'den html çekmek istediğinizi düşünelim:
Uri url = new Uri("https://www.bloomberght.com/doviz/euro");
using (var client = new WebClient())
{
string html = client.DownloadString(url);
}
Şu hatayı alabilirsiniz:

Bu hatayı aldığınızda yapmanız gereken şu satırı eklemek:
Uri url = new Uri("https://www.bloomberght.com/doviz/euro");
using (var client = new WebClient())
{
ServicePointManager.Expect100Continue = true;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
string html = client.DownloadString(url);
}
ServicePointManager.Expect100Continue = true;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
satırlarını client.DownloadString()'ten önce bir yerlere yazmanız yeterli.
Kolay gelsin.
#ServicePointManager #SecurityProtocol #DownloadString #DownloadData #WebClient #ssl #tls #güvenli-kanal