• Register
0 votes
121 views

Problem :

I want to tell you that I have researched a lot for this issue but without a solution. I have created the loop that will go throw my listBox1 and that contains the links, each time creating the http GET request in order to access my full source code.

The error below is often triggered when my loop hits various of urls The weirdest thing is that if I try to remove my loop and make the http GET request to that site then everything works without any issue.

“A first chance exception of type 'System.Net.WebException' occurred in System.dll System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IOException: Authentication failed because the remote party has closed the transport stream.”

I don't consider that it's the problem with my certificate as otherwise I would still get the error when I removed my loop.

Any suggestions are highly appreciated.

7.5k points

1 Answer

0 votes

Solution :

I had also faced the similar issue in the recent past. I did lot of research on it and found the solution on it. This is the very common problem with the people getting started.

This is happening due to the security protocol issue.

You need to just add the below line before your request context.

 ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;

This change will resolve your issue.

36.1k points

Related questions

0 votes
1 answer 55 views
55 views
Problem : I have recently installed a website on my local machine using IIS 7 successfully. But when I tried to deploy it on the live server, I got a following error: "The page cannot be displayed because an internal server error has occurred" Nothing else. Using a same IIS 7 on live and also set to have the Detailed errors in Error Pages module, but still getting a same. What can be the reason?
asked Jan 28 jwilliam 3.9k points
0 votes
1 answer 71 views
71 views
Problem : I am facing following c# socket issue the i/o operation has been aborted because of either a thread exit or an application request
asked Nov 16, 2019 peterlaw 6.9k points
0 votes
1 answer 23 views
23 views
Problem : I am using a SmtpClient library to send the emails using a below code : SmtpClient smtpclient = new SmtpClient(); smtpclient.Host = "hostname"; smtpclient.Port = 465; smtpclient.DeliveryMethod = SmtpDeliveryMethod.Network; smtpclient.UseDefaultCredentials = false; smtpclient. ... port opens just fine between a client and a server. I am not sure at all what else could throw above error.
asked Jan 29 jwilliam 3.9k points
0 votes
1 answer 22 views
22 views
Problem : I am beginner in C#. I am trying to write the Function using C#. But while executing my code I am facing below error “The connection was not closed. The connection's current state is open.” How to fix above error?
asked Feb 27 mphil 2.3k points
0 votes
1 answer 127 views
127 views
Problem : When I am attempting to connect to MSSQL database via ASP.NET online, I will often get the below error when two or more people try to connect simultaneously: ExecuteReader requires an open and available Connection. The connection's current state is Connecting. My site works fine on the localhost server. May I know what might have gone wrong with my site and how can I fix the error?
asked Jan 31 jwilliam 3.9k points