Jenkins.NET icon indicating copy to clipboard operation
Jenkins.NET copied to clipboard

Unable to read data from the transport connection

Open ismailmayat opened this issue 4 years ago • 1 comments

Expected Behavior Tried to make calls to build and Get however get following error:

Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.

I tried to setup TLS and also tried to ignore any SSL errors but still get same error.

ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls12; ServicePointManager.ServerCertificateValidationCallback += (sender, certificate, chain, sslPolicyErrors) => true;

When I make curl requests using same build url and user and token it works fine.

Your Environment I am running windows server 2016 and Jenkins ver. 2.222.1 My client code is .net 45

ismailmayat avatar Jun 16 '20 15:06 ismailmayat

Update on this, if before making calls i add

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

I get a bit further I now get content length 0 error. I downloaded source and in CreateRequest added

request.ContentLength = 0;

everything now works

ismailmayat avatar Jun 17 '20 09:06 ismailmayat