Jump to content
Guest

[C#]Problema HttpWebRequest

Recommended Posts

Posted (edited)

Salut,

 

Fac niste requesturi catre OLX.ro si am intampinat o problema. Cand fac request cu IP-ul meu sau cu un VPN requesturile se duc fara probleme, dar am incercat cu niste http proxies (pe care le-am verificat in prealabil si ar trebui sa mearga) si primesc eroarea asta mereu:

 

The underlying connection was closed: The connection was closed unexpectedly.

 

Am cautat pe stackoverflow si am incercat urmatoarele posibilitati unele chiar in combinatie:

 

                          webRequest.KeepAlive = false;

                        webRequest.ServicePoint.Expect100Continue = false;
                        
                        ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; // <- pus inaintea requestului, olx foloseste TLS 1.2
                       
                       webRequest.Timeout = 3000;

 

Primesc aceeasi eroare. Poate cineva mai priceput sa imi zica ce as putea face? Ciudat este ca de pe VPN nu ar trebui sa mearga si totusi merge, dar cu proxyuri nu...

 

@dancezar Scuze ca iti dau tag sunt sigur ca esti ocupat, dar poate vezi si imi dai vreo idee...

 

PS: Am folosit http proxies, porturi 80 si 8080

Edited by Guest
Posted

Raspunsul la problema este ca nu ii activam si SSL3...

 

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

 

Cu asta merge brici. Mersi mult @gigiRoman.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...