While configuring a TFS vNext build agent i am getting the error:
ErrorConnectingToTheServer An error occurred while sending the request. the request.
I could not find any other error message in the event log or anywhere else.
Please help.
Update1: The SSL (https///tfs) did not work.but the plain http:// worked.
Update 2: I have removed the old agents and trying to configure new one. While doing that i am getting the below error that is present in the _diag folder:
System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host .... System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host .... System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host .... System.Net.Sockets.SocketException (0x80004005): An existing connection was forcibly closed by the remote host
Update 3: I have two servers as below: 1 is application server and other is SharePoint and reporting server trying to configure the build in 3rd server. TFS URL is configured with SSL 443.
If I try to configure the agent using http://tfs server/tfs it succeeds, but receives error while building. When i try to configure using https i get the above error. Interestingly I had used this server for two agents, and in that case i had one more server where i am getting the error was working properly.
I finally found the solution to the issue:
Root cause: TFS vNext agents use .Net framework 4.5... which by default does not support TLS 1.1/ TLS 1.2.
Solution: We need to modify .Net framework registry entry to direct .Net framework to use TLS 1.2. Use the command to update the registry:
reg add HKLM\SOFTWARE\Microsoft\.NETFramework\v4.0.30319 /v SchUseStrongCrypto /t REG_DWORD /d 1 /reg:64 (and/or /reg:32)
Referred here: