system.net.httpPost() getting the error IOError: Received fatal alert: handshake_failure

Hello,

I’m trying to send a json data to an API with httpPost but i’m getting this error and didn’t found nothing that could help me:

Traceback (most recent call last):
  File "<event:actionPerformed>", line 7, in <module>
IOError: Received fatal alert: handshake_failure

Ignition v7.9.16 (b2020090709)
Java: Oracle Corporation 1.8.0_92

Here is my code:

opPythonDict = {"opNum":123, "product":"teste"}

opstring = system.util.jsonEncode(opPythonDict)

apiKey = "1a2b3c123abc4"

system.net.httpPost(url="https://sgrefratarios.indwise.com/api/integration/op?apiKey="+apiKey, contentType="application/json", postData=opstring)

What am I doing wrong?

So, you left your URL unscrubbed, and I was able to look and see that the certificate that server is using is signed by Let’s Encrypt.

I think that you may be on a version of Java 8 that is too old to contain the Let’s Encrypt root in its trust store. I’m not sure what context you’re executing this script from, but you may need to update to the latest Java 8 release.

1 Like