I have a web app that sends API requests to the UiPath cloud Orchestrator. The code that communicates with Orchestrator works fine when used standalone, and at first when used by the web app, which runs under IIS. After a time, possibly when IIS recycles the app pool, the communication to the Orchestrator stops working. The same calls that worked before now return “SSL error”, specifically:
.NET Runtime
Application: w3wp.exe
CoreCLR Version: 6.0.622.26707
.NET Version: 6.0.6
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AggregateException: One or more errors occurred. (The SSL connection could not be established, see inner exception.)
—> System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception.
—> 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 (10054): An existing connection was forcibly closed by the remote host.
— End of inner exception stack trace —
Every attempt I do for a connection is a “new” connect, using the client token and client secret. I’m not trying to use refresh tokens. This approach works endlessly, as long as I continually use the web app.
I’m using C# Razor with RestSharp for my stack. I’ve implemented something similar to what’s described here for authentication. It works in the non-web case. I’ve created a library of methods for getting info from the Orchestrator and starting jobs, and this is used in a functional console program as well as this web app. It only stops working after sitting idle for about an hour, and I cannot figure out why. Any help would be greatly appreciated!