Skip to content

Commit

Permalink
Removed client certificate if security mode None
Browse files Browse the repository at this point in the history
  • Loading branch information
mikakaraila committed Jul 20, 2020
1 parent 9521a81 commit 4eee0e1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
11 changes: 8 additions & 3 deletions opcua/102-opcuaclient.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,14 @@ module.exports = function (RED) {
if (!clientPkg)
verbose_warn("Cannot find node-opcua-client package with client certificate");
// Client certificate from node-opcua-client\certificates, created by node-opcua installation
connectionOption.certificateFile = path.join(clientPkg, "/certificates/client_selfsigned_cert_2048.pem"),
connectionOption.privateKeyFile = path.join(clientPkg, "/certificates/PKI/own/private/private_key.pem")
verbose_log("Using client certificate " + connectionOption.certificateFile);
if (connectionOption.securityPolicy !== opcua.SecurityPolicy.None) {
connectionOption.certificateFile = path.join(clientPkg, "/certificates/client_selfsigned_cert_2048.pem"),
connectionOption.privateKeyFile = path.join(clientPkg, "/certificates/PKI/own/private/private_key.pem")
verbose_log("Using client certificate " + connectionOption.certificateFile);
}
else {
verbose_log("Client certificate not used!");
}

connectionOption.endpoint_must_exist = false;
connectionOption.defaultSecureTokenLifetime = 40000;
Expand Down
4 changes: 2 additions & 2 deletions opcua/104-opcuaserver.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ module.exports = function (RED) {
};
server_options.buildInfo = {
productName: node.name.concat(" OPC UA server for node-red"),
buildNumber: "0.2.68",
buildDate: "2020-07-19T12:24:00"
buildNumber: "0.2.69",
buildDate: "2020-07-20T10:43:00"
};
verbose_log("Server options:" + JSON.stringify(server_options));
server = new opcua.OPCUAServer(server_options);
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-red-contrib-opcua",
"version": "0.2.68",
"version": "0.2.69",
"description": "A Node-RED node to communicate via OPC UA based on node-opcua library.",
"repository": {
"type": "git",
Expand Down Expand Up @@ -37,7 +37,7 @@
"colors": "^1.3.3",
"es6-map": "^0.1.5",
"get-installed-path": "^4.0.8",
"node-opcua": "^2.5.11",
"node-opcua": "^2.7.0",
"treeify": "^1.1.0"
},
"homepage": "https://github.com/mikakaraila/node-red-contrib-opcua#readme",
Expand Down

0 comments on commit 4eee0e1

Please sign in to comment.