# system.net.httpClient() Concept overview

**URL:** <https://forum.inductiveautomation.com/t/system-net-httpclient-concept-overview/64516>\
**Category:** Ignition\
**Created:** [September 27, 2022, 8:53am UTC](https://forum.inductiveautomation.com/t/system-net-httpclient-concept-overview/64516 "2022-09-27T08:53:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bogdan](https://avatars.discourse-cdn.com/v4/letter/b/ce7236/32.png) [@Bogdan](https://forum.inductiveautomation.com/u/Bogdan)\
**Post date:** [September 27, 2022, 8:53am UTC](https://forum.inductiveautomation.com/t/system-net-httpclient-concept-overview/64516/1 "2022-09-27T08:53:50Z")

</div>

Hello,

We are currently using HTTP Client in a couple of projects and we are struggling with an specific error that pop’s up randomly in different gateways.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/e/7ee905cc4ba8533ecd1cfb652b01abcc4aef26c0.png)

Short description:  
The entire code is placed in the gateway project library.  
We are using scheduled Task to run the API’s at a specific point in time

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/7/97d7ce8ca2e4a80af3b6f4709de546610ab13eed.png)

Done a little bit of research about HttpClient:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/d/fdef34ec4396b40b2c99c28325cf5c22dfea9f87.png)

After using HTTP Client via Ignition [System.net](http://System.net) do we need to run something to release the resources? or this is done automatically?

What is the recommended approach when we speak about:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/6/26524256c4bf5d62145a7b952b04bd2255679516.png)

Thanks,  
Bogdan

---

<div class="post-metadata">

**Author:** ![plo](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/plo/32/33875_2.png) [@plo](https://forum.inductiveautomation.com/u/plo)\
**Post date:** [October 3, 2022, 9:39pm UTC](https://forum.inductiveautomation.com/t/system-net-httpclient-concept-overview/64516/2 "2022-10-03T21:39:36Z")

</div>

Hello Bogdan,

Can you paste the full error stack here? From that short snippet, it looks like the URL/Server is closing the connection on Ignition's HTTP Client request?

How often does this issue occur? Everyday? Once a week?

The script will automatically release the resource when the script is completed.

---

<div class="post-metadata">

**Author:** ![Bogdan](https://avatars.discourse-cdn.com/v4/letter/b/ce7236/32.png) [@Bogdan](https://forum.inductiveautomation.com/u/Bogdan)\
**Post date:** [October 14, 2022, 12:43pm UTC](https://forum.inductiveautomation.com/t/system-net-httpclient-concept-overview/64516/3 "2022-10-14T12:43:34Z")

</div>

[full error stack.txt](https://forum.inductiveautomation.com/uploads/short-url/42WXHgpoDvq55LSzBUgPcTOrWaL.txt) (9.3 KB)  
[RBW-MESOPC08-Prod\_thread\_dump20221014-152812.json](https://forum.inductiveautomation.com/uploads/short-url/oRNPoOIHADaB97twVPqYulQsNgU.json) (145.4 KB)

Hard to say...I haven't been able to find a pattern how often this problem occurs

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [October 14, 2022, 12:46pm UTC](https://forum.inductiveautomation.com/t/system-net-httpclient-concept-overview/64516/4 "2022-10-14T12:46:35Z")

</div>

The error you just attached is different than the one in your original post.

```auto
javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

```

It implies you're connecting to a server via HTTPS which has a certificate that is not trusted.

The original error was the connection being closed by something external to Ignition. Other side, firewall, etc...
