Hello guys,
I cannot communicate with my server only from CloudScript. I can make requests from Postman, Curl, Java, etc... But when using a CloudScript function I got this strange error:
{ "Level": "Debug", "Message": "{\"cloudScriptErrorCode\":\"CloudScriptHTTPRequestError\",\"stack\":\"Error\\n at Object.http_request (Script:224:28)\\n at Object.request (Script:263:35)\\n at handlers.test (ED373-main.js:141:25)\\n at Object.invokeFunction (Script:116:33)\",\"requestInfo\":{\"url\":\"https://example.com/test\",\"method\":\"get\",\"result\":{\"responseContent\":null,\"httpStatus\":null,\"httpStatusCode\":0,\"requestError\":\"SecureChannelFailure\"},\"httpRequestError\":\"SecureChannelFailure\"}}", "Data": null }
This is my function:
handlers.test = function (args, context) { var url = "https://example.com/test"; var httpMethod = "get"; var response; try { response = http.request(url, httpMethod); } catch(error) { log.debug(error); } }I own the server and the request is not even reaching my server when checking the logs. Can someone help me on this?
IMPORTANT INFO:
I allowed only for testing HTTP instead HTTPS, and worked fine. CloudScript is having some problem with my certificate. But is working fine with other http clients.
I suspect of one thing, a few weeks ago we had the example.com server in one machine (OLD). Then we changed the example.com to another machine (NEW) with a new IP address. Can be this the problem?
And right now the (OLD) has a different SSL certificate: example.dev
Thank you!
SP