Certificate Issues - Calling API without bypassingCertification always results in the following error message: IOError: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
At our facilities we use a lot of APIs to allow us to interact with software that we would otherwise not have any access to... recently we added certificates to our Ignition gateways in an attempt to keep things as secure as possible. The API calls that we are using work well, however when we try to call them in Ignition we Almost always get the error message shown above. The ONLY instance that I am aware of where this is not happening is a form that calls the same API that generated the error message shown here from within a Change Script of a text field. When I target the API with a get request, from within the context of that field the data is returned to me as if I had the "bypassCertValidation = True " switch on the call... but I do not.
When I run the API call from the update script of that text field, I don't get any error messages , not in the log, not on the form... no where. Now, I can copy that call directly from that script into the script console, and it gives an error every time I try to run it.
I have tested it from 4 or 5 of our gateways including one of which is running a certificate as a web server directly... and I still get the same error.
I have reviewed the forums , and I have copied the certificate for the API destination url to gateway's certificate store , I have copied it to the client certificate store... a lot of things in between... I went through every forum post that I could find with regard to this, and still I am getting the same results...
Does anyone have any idea what my issue could be?
The CA is not self signed , but was purchased form a certificate Authority - and I have tried various formats of it as well.
Honestly I don't know what to try next...
The next two screenshots are examples of one of the APIs that I have tested (We have over a dozen, and every one that I test results in the same error)
(Here is the example of my code failing with this error message:
"sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target" )
Here is an example of that exact same code, with one change - I added the following switch in the client declaration: ... see line 18 in the script console screen shot...
I can add an actual copy of the script if it will help... if you have any ideas, I'll be happy to implement them... at this point, I am not really sure where to go. I don't know if this is something that has not been enabled yet, or if there's an issue with my implementation: however, I can run these APIs in testing applications such as SoapUI, and it succeeds without issue.
As I mentioned before, if I take the code for one of the APIs and run it inside of a field change event script, it will succeed without having to bypass the certification.
Here is the script itself:
and here is a screen shot of the control itself that I took this example from: