H
H
hr_lolka2017-06-26 22:08:45
C++ / C#
hr_lolka, 2017-06-26 22:08:45

C# how to fix xnet sll connection error?

Good time of the day, please help me solve the problem: when I try to make a request to the site sscasino.online gives an error

xNet.HttpException" в xNet.dll ("Не удалось установить SSL-соединение с HTTP-сервером 'sscasino.online'.") xNet.HttpException (xNET)

and
System.Net.WebException" в System.dll ("Базовое соединение закрыто: Непредвиденная ошибка при передаче.") System.Net.WebException (WebRequest)

request.UserAgent = useragent;
request.IgnoreProtocolErrors = true;
request.SslCertificateValidatorCallback += (sender, certificate, chain, sslPolicyErrors) => true;

var result = request.Get(link);

and
WebRequest req = WebRequest.Create(Url);
  WebResponse resp = req.GetResponse();
  Stream stream = resp.GetResponseStream();
  StreamReader sr = new StreamReader(stream);
  string Out = sr.ReadToEnd();
  sr.Close();

Found a solution for WebRequest
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

But it is necessary for xNEt, can you help?
At the same time, if you enable http debbuger pro, then the requests go normally. Tested on multiple machines

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question