system.net.httpClient() Concept overview

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.

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

Done a little bit of research about HttpClient:

After using HTTP Client via Ignition 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:

Thanks,
Bogdan

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.

full error stack.txt (9.3 KB)
RBW-MESOPC08-Prod_thread_dump20221014-152812.json (145.4 KB)

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

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

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

2 Likes