admin管理员组

文章数量:1022804

I am trying to call RESTful service (out side of my domain) in a simple Node-Red flow.

The flow is illustrated in the following diagram:

The function for calling the service:

var data = {};
data[“someparameter”] = “somevalue”;
msg.method = "POST";
msg.headers = { "Content-Type": "application/json" };
msg.payload = JSON.stringify(data);
msg.url = "https://myserviceip/myendpoint/mymethod”;
return msg;

Nonetheless i get the following error:

"Error: unable to verify the first certificate : https://myserviceip/myendpoint/mymethod"

Setting the msg.rejectUnauthorized in the header to false did not work.

msg.rejectUnauthorized = false;  // to avoid the error but it does not work

I am trying to call RESTful service (out side of my domain) in a simple Node-Red flow.

The flow is illustrated in the following diagram:

The function for calling the service:

var data = {};
data[“someparameter”] = “somevalue”;
msg.method = "POST";
msg.headers = { "Content-Type": "application/json" };
msg.payload = JSON.stringify(data);
msg.url = "https://myserviceip/myendpoint/mymethod”;
return msg;

Nonetheless i get the following error:

"Error: unable to verify the first certificate : https://myserviceip/myendpoint/mymethod"

Setting the msg.rejectUnauthorized in the header to false did not work.

msg.rejectUnauthorized = false;  // to avoid the error but it does not work
Share Improve this question edited Mar 23, 2017 at 19:00 Bashar Altakrouri asked Mar 23, 2017 at 18:01 Bashar AltakrouriBashar Altakrouri 10.6k1 gold badge42 silver badges55 bronze badges 2
  • 1 More information is required here, I assume the function node is feeding into a http-request node? – hardillb Commented Mar 23, 2017 at 18:17
  • Thanks @hardill, as requested the flow is added – Bashar Altakrouri Commented Mar 23, 2017 at 19:01
Add a ment  | 

1 Answer 1

Reset to default 5

Having had a look at the http-request node I don't think it's possible at the moment based on a flag in the ining message, but it can be done in the node editor. Double click on the http-request node, then tick the "Enable secure (SSL/TLS) connection" checkbox. Next create a new TLS Config and then uncheck the "Verify server certificate" checkbox.

Save all that and it should work

But having said that I don't think it would be that hard to update the http-request node to support the msg.rejectUnauthorized. I'll look at sticking a pull request in (https://github./node-red/node-red/pull/1207).

I am trying to call RESTful service (out side of my domain) in a simple Node-Red flow.

The flow is illustrated in the following diagram:

The function for calling the service:

var data = {};
data[“someparameter”] = “somevalue”;
msg.method = "POST";
msg.headers = { "Content-Type": "application/json" };
msg.payload = JSON.stringify(data);
msg.url = "https://myserviceip/myendpoint/mymethod”;
return msg;

Nonetheless i get the following error:

"Error: unable to verify the first certificate : https://myserviceip/myendpoint/mymethod"

Setting the msg.rejectUnauthorized in the header to false did not work.

msg.rejectUnauthorized = false;  // to avoid the error but it does not work

I am trying to call RESTful service (out side of my domain) in a simple Node-Red flow.

The flow is illustrated in the following diagram:

The function for calling the service:

var data = {};
data[“someparameter”] = “somevalue”;
msg.method = "POST";
msg.headers = { "Content-Type": "application/json" };
msg.payload = JSON.stringify(data);
msg.url = "https://myserviceip/myendpoint/mymethod”;
return msg;

Nonetheless i get the following error:

"Error: unable to verify the first certificate : https://myserviceip/myendpoint/mymethod"

Setting the msg.rejectUnauthorized in the header to false did not work.

msg.rejectUnauthorized = false;  // to avoid the error but it does not work
Share Improve this question edited Mar 23, 2017 at 19:00 Bashar Altakrouri asked Mar 23, 2017 at 18:01 Bashar AltakrouriBashar Altakrouri 10.6k1 gold badge42 silver badges55 bronze badges 2
  • 1 More information is required here, I assume the function node is feeding into a http-request node? – hardillb Commented Mar 23, 2017 at 18:17
  • Thanks @hardill, as requested the flow is added – Bashar Altakrouri Commented Mar 23, 2017 at 19:01
Add a ment  | 

1 Answer 1

Reset to default 5

Having had a look at the http-request node I don't think it's possible at the moment based on a flag in the ining message, but it can be done in the node editor. Double click on the http-request node, then tick the "Enable secure (SSL/TLS) connection" checkbox. Next create a new TLS Config and then uncheck the "Verify server certificate" checkbox.

Save all that and it should work

But having said that I don't think it would be that hard to update the http-request node to support the msg.rejectUnauthorized. I'll look at sticking a pull request in (https://github./node-red/node-red/pull/1207).

本文标签: javascriptError unable to verify the first certificate in NodeRedStack Overflow