HttpClient Get Error

Hi All,

I am having issues with HttpClient.Get().

I have been getting some values from an API. The following script worked consistently for the last 9 months:

def getData(accessToken):
	headers={"Authorization":accessToken}
	url=system.tag.getTagValue('[Humerd]LoadFlex/Credentials/ForecastURL')
	client=system.net.httpClient()
	response = client.get(url=url, headers=headers)

Some changes were made on the API and now the same script doesn't work.

I get a huge list of errors. These ones stood out:

java.io.IOException: java.io.IOException: Unable to GET https://**********************/forecastdata

Caused by: javax.net.ssl.SSLHandshakeException: Remote host terminated the handshake

On my test laptop the same script works fine. What's going on here? Has anyone come across this?

I tried setting the http client to http_1_1 as well. Didn't work. It seems the API doesn't like something in our request and shuts down the connection.

I can provide my full script if necessary.

Thank you all.

Best Regards,
Sasi

You'll need to see the logs from the other end to figure this out. "Remote host terminated the handshake" means it isn't Ignition's fault. That it used to work, and now doesn't, means the API changes on the other end are responsible, and you need detailed information about those changes to figure it out.

You may also need to use wireshark to see what is happening "on the wire" during the handshake.

Thanks pturmel.

Thats exactly what I am thinking.

However, from my test laptop, the exact same script is able to get data from the API. I even upgraded the site Ignition to 8.1.35 to match that of my laptop, still same result. Could whatever httpclient.get() relies on be different between the site pc and my laptop? I don't know. This is whats confusing me.

This maybe a good incentive to actually learn wireshark!

When different behaviors appear in two locations, same code, I suspect firewalls.

1 Like