question

SP avatar image
SP asked

CloudScript issue with SSL certificate

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

CloudScript
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Citrus Yan avatar image
Citrus Yan answered

If you don’t mind, may I know which URL you were trying to reach (just tell me which line it is in your CloudScript code)? We’ll try to reproduce this from our side and investigate further.

BTW, not sure if it helps, we saw a similar one which was caused by an issue with the Nginx cipher used, please take a look: https://community.playfab.com/questions/38920/cloudscript-having-http-request-issues-to-tsl-12.html

3 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

SP avatar image SP commented ·

@Citrus Yan Thanks for reply!

The issue related with Nginx cipher, in our logs we don't have any error at all. I think that is not the problem.


The url is https://api.anybrain.gg.

0 Likes 0 ·
Citrus Yan avatar image Citrus Yan SP commented ·

Just tested on my side and I received the same error, and I can also see that the other url(ends with "dev") works according to your title's event history, therefore, I suspect that this issue might have something to do with the cert you mentioned above, please check on that.

0 Likes 0 ·
SP avatar image SP Citrus Yan commented ·

Hi Citrus, thanks for the reply! Can you please delete this post or hide my api url? Because I cannot edit or remove anything. Thanks

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.