• Register
Welcome to Kodlogs, programming questions and answer website.
0 votes

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.

by (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.

by (34.3k points)