TL;DR - Using a SNAP PAC I’m trying to ping a local HTTP API that I can successfully access using Bruno, and the attempt is failing with a SSL Handshake error. (I think)
Details:
I have a device on the network with an HTTP accessible API. I can successfully access the device using Bruno (a standalone API tester) and the following parameters:
https://[destination ip address, no port number]/[api directory]
Header: “Content-Type: application/json”
Body: “[JSON string of API request info]”
Using these parameters I get back the expected response from the device.
I’m attempting to replicate this ping using the HTTPPostFromStringTable command in PACControl, however, I cannot successfully connect to the device. I have tried all four permutations of security mode 0 and 1, and HTTP port 80 and 443, and I get the following responses:
80, 0 : -412 Cannot Connect
80, 1: -412 Cannot Connect
443, 0: -443 Could Not Receive on Socket
443, 1: -2103 SSL Handshake Failed
Now, given that the API tester is using an https address for the request, I’m assuming that it’s connecting on port 443, so I’m guessing that the last case is the one I should focus on.
However, I want to be clear that the API tester doesn’t have a certificate associated with this device, nor does this API call require authentication - it works great from the API tester with no further credentials required.
Here’s my PAC Control code:
HTTP_Post_Content[0] = “[json of post request, with quotation marks painstakingly inserted as control characters]”;
HTTP_Post_Header[0] = “Content-Type: application/json”;
HTTP_SendStatus = HttpPostFromStringTable(
HTTP_Response_Content,
HTTP_Response_Header,
HTTP_Post_Content,
HTTP_Post_Header,
1,
“/api/[apidir]”,
HTTP_Status,
443,
“xxx.xxx.xxx.xxx”);
Am I missing something obvious? Thanks!