In Ignition 8.0.16 I have code that builds a URL then uses system.net.httpGet( url=siteUrl, headerValues=siteHeader.
It works when called from a script; it works when called from the Script Console; it works when I paste it into a browser (Chrome and Edge); it works in a MinGW64 session; it works when running directly on the Gateway Server and from my workstation.
When I call it in a Gateway Event script, specifically, via system.util.sendRequest, or in a Tag Event script, it generates the error:
IOError: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
It errors even when I hard code the working URL directly in the Gateway Event script or Tag Event script.
Is there a security setting or a bug that’s getting in the way?
I am moving the code from Ignition 7.9 where a tag event script calls a shared script (has been in production for 4 years now). I need to find a robust way for tag events in 8.x to both GET and POST to a web API and would prefer to have the script in a sharable location to be called from UDT tags.
I’m open to alternative solutions.