node-opcua-client 2.85.0 → 2.86.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/alarms_and_conditions/client_alarm_tools_dump_event.js +1 -2
- package/dist/alarms_and_conditions/client_alarm_tools_dump_event.js.map +1 -1
- package/dist/alarms_and_conditions/client_tools.js +1 -2
- package/dist/alarms_and_conditions/client_tools.js.map +1 -1
- package/dist/client_monitored_item_toolbox.js +1 -2
- package/dist/client_monitored_item_toolbox.js.map +1 -1
- package/dist/client_session_keepalive_manager.js +1 -2
- package/dist/client_session_keepalive_manager.js.map +1 -1
- package/dist/client_utils.js +1 -2
- package/dist/client_utils.js.map +1 -1
- package/dist/private/client_base_impl.js +10 -2
- package/dist/private/client_base_impl.js.map +1 -1
- package/dist/private/client_monitored_item_impl.js +3 -4
- package/dist/private/client_monitored_item_impl.js.map +1 -1
- package/dist/private/client_session_impl.d.ts +2 -2
- package/dist/private/client_session_impl.js +1 -1
- package/dist/private/client_session_impl.js.map +1 -1
- package/dist/private/client_subscription_impl.js +1 -1
- package/dist/private/client_subscription_impl.js.map +1 -1
- package/dist/private/opcua_client_impl.js +3 -2
- package/dist/private/opcua_client_impl.js.map +1 -1
- package/dist/reconnection.js +1 -1
- package/dist/reconnection.js.map +1 -1
- package/dist/tools/read_history_server_capabilities.js +2 -3
- package/dist/tools/read_history_server_capabilities.js.map +1 -1
- package/dist/verify.js +1 -1
- package/dist/verify.js.map +1 -1
- package/package.json +41 -41
- package/source/alarms_and_conditions/client_alarm_tools_dump_event.ts +1 -2
- package/source/alarms_and_conditions/client_tools.ts +1 -1
- package/source/client_monitored_item_toolbox.ts +1 -1
- package/source/client_session_keepalive_manager.ts +1 -1
- package/source/client_utils.ts +1 -1
- package/source/private/client_base_impl.ts +15 -2
- package/source/private/client_monitored_item_impl.ts +4 -5
- package/source/private/client_session_impl.ts +3 -3
- package/source/private/client_subscription_impl.ts +1 -1
- package/source/private/opcua_client_impl.ts +7 -7
- package/source/reconnection.ts +2 -2
- package/source/tools/read_history_server_capabilities.ts +2 -2
- package/source/verify.ts +2 -1
|
@@ -9,7 +9,6 @@ const node_opcua_constants_1 = require("node-opcua-constants");
|
|
|
9
9
|
const node_opcua_data_model_1 = require("node-opcua-data-model");
|
|
10
10
|
const node_opcua_nodeid_1 = require("node-opcua-nodeid");
|
|
11
11
|
const node_opcua_service_translate_browse_path_1 = require("node-opcua-service-translate-browse-path");
|
|
12
|
-
const node_opcua_status_code_1 = require("node-opcua-status-code");
|
|
13
12
|
const node_opcua_utils_1 = require("node-opcua-utils");
|
|
14
13
|
function readHistoryServerCapabilities(session, callback) {
|
|
15
14
|
if (!callback) {
|
|
@@ -25,7 +24,7 @@ function readHistoryServerCapabilities(session, callback) {
|
|
|
25
24
|
if (!result) {
|
|
26
25
|
return callback(new Error("Internal Error"));
|
|
27
26
|
}
|
|
28
|
-
if (result.statusCode
|
|
27
|
+
if (result.statusCode.isNotGood()) {
|
|
29
28
|
return callback(new Error("StatusCode = " + result.statusCode.toString()));
|
|
30
29
|
}
|
|
31
30
|
result.targets = result.targets || [];
|
|
@@ -67,7 +66,7 @@ function readHistoryServerCapabilities(session, callback) {
|
|
|
67
66
|
if (!results) {
|
|
68
67
|
return callback(new Error("Internal Error"));
|
|
69
68
|
}
|
|
70
|
-
const nodeIds = results.map((innerResult) => innerResult.statusCode
|
|
69
|
+
const nodeIds = results.map((innerResult) => innerResult.statusCode.isGood() && innerResult.targets
|
|
71
70
|
? innerResult.targets[0].targetId
|
|
72
71
|
: new node_opcua_nodeid_1.NodeId());
|
|
73
72
|
const nodesToRead = nodeIds.map((nodeId) => ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read_history_server_capabilities.js","sourceRoot":"","sources":["../../source/tools/read_history_server_capabilities.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,yDAA2C;AAC3C,+DAAiD;AACjD,iEAAqD;AAErD,yDAA2C;AAE3C,uGAAwG;
|
|
1
|
+
{"version":3,"file":"read_history_server_capabilities.js","sourceRoot":"","sources":["../../source/tools/read_history_server_capabilities.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,yDAA2C;AAC3C,+DAAiD;AACjD,iEAAqD;AAErD,yDAA2C;AAE3C,uGAAwG;AAExG,uDAAoD;AAcpD,SAAgB,6BAA6B,CACzC,OAAsB,EACtB,QAAgF;IAEhF,IAAI,CAAC,QAAQ,EAAE;QACX,MAAM,IAAI,KAAK,CAAC,gBAAgB,CAAC,CAAC;KACrC;IACD,wCAAwC;IACxC,MAAM,UAAU,GAAe,IAAA,yDAAc,EAAC,gCAAS,CAAC,aAAa,EAAE,sDAAsD,CAAC,CAAC;IAE/H,OAAO,CAAC,mBAAmB,CAAC,UAAU,EAAE,CAAC,GAAiB,EAAE,MAAyB,EAAE,EAAE;QACrF,IAAI,GAAG,EAAE;YACL,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC;SACxB;QACD,0BAA0B;QAC1B,IAAI,CAAC,MAAM,EAAE;YACT,OAAO,QAAQ,CAAC,IAAI,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC;SAChD;QACD,IAAI,MAAM,CAAC,UAAU,CAAC,SAAS,EAAE,EAAE;YAC/B,OAAO,QAAQ,CAAC,IAAI,KAAK,CAAC,eAAe,GAAG,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;SAC9E;QAED,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC;QAEtC,MAAM,+BAA+B,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;QACnE,2BAA2B;QAC3B,IAAA,0BAAM,EAAC,+BAA+B,CAAC,QAAQ,EAAE,KAAK,cAAc,CAAC,CAAC;QAEtE,4BAA4B;QAC5B,MAAM,UAAU,GAAG;YACf,6BAA6B;YAC7B,+BAA+B;YAC/B,wBAAwB;YACxB,qBAAqB;YACr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AC,IAAkB,EAAE,UAAwB,EAAE,EAAE;gBACvE,IAAI,IAAI,EAAE;oBACN,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC;iBACzB;gBACD,0BAA0B;gBAC1B,IAAI,CAAC,UAAU,EAAE;oBACb,OAAO,QAAQ,CAAC,IAAI,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC;iBAChD;gBAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;oBACxC,MAAM,QAAQ,GAAG,IAAA,mCAAgB,EAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;oBACjD,IAAI,CAAC,QAAQ,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,KAAgB,CAAC;iBACnD;gBACD,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YACzB,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC;AA/FD,sEA+FC;AACD,iCAAiC;AACjC,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AACnC,MAAM,IAAI,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;AACjC,MAAc,CAAC,OAAO,CAAC,6BAA6B,GAAG,OAAO,CAAC,YAAY,CACvE,MAAc,CAAC,OAAO,CAAC,6BAA6B,EACrD,IAAI,CACP,CAAC"}
|
package/dist/verify.js
CHANGED
|
@@ -104,7 +104,7 @@ function performCertificateSanityCheck(serverOrClient, certificateManager, appli
|
|
|
104
104
|
return __awaiter(this, void 0, void 0, function* () {
|
|
105
105
|
// verify that certificate is matching private key, and inform the developper if not
|
|
106
106
|
const certificate = this.getCertificate();
|
|
107
|
-
const privateKey =
|
|
107
|
+
const privateKey = this.getPrivateKey();
|
|
108
108
|
//
|
|
109
109
|
if (!(0, node_opcua_crypto_1.publicKeyAndPrivateKeyMatches)(certificate, privateKey)) {
|
|
110
110
|
errorLog("[NODE-OPCUA-E01] Configuration error : the certificate and the private key do not match !");
|
package/dist/verify.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify.js","sourceRoot":"","sources":["../source/verify.ts"],"names":[],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"verify.js","sourceRoot":"","sources":["../source/verify.ts"],"names":[],"mappings":";;;;;;;;;;;;AAIA,yDAM2B;AAC3B,uDAAiG;AAEjG,MAAM,OAAO,GAAG,IAAA,iCAAc,EAAC,UAAU,CAAC,CAAC;AAC3C,MAAM,QAAQ,GAAG,IAAA,gCAAa,EAAC,UAAU,CAAC,CAAC;AAC3C,MAAM,QAAQ,GAAG,IAAA,gCAAa,EAAC,UAAU,CAAC,CAAC;AAC3C,MAAM,UAAU,GAAG,IAAA,kCAAe,EAAC,UAAU,CAAC,CAAC;AAE/C,SAAgB,6BAA6B,CACzC,WAAwB,EACxB,eAAuB,EACvB,IAAyB,EACzB,cAAsB;;IAEtB,MAAM,eAAe,GAAG,IAAA,sCAAkB,EAAC,WAAW,CAAC,CAAC;IACxD,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;IAEvB,IAAI,eAAe,CAAC,cAAc,CAAC,QAAQ,CAAC,SAAS,CAAC,OAAO,EAAE,GAAG,GAAG,CAAC,OAAO,EAAE,EAAE;QAC7E,mCAAmC;QACnC,gCAAgC;QAChC,UAAU,CACN,sDAAsD;YAClD,mBAAmB,eAAe,CAAC,cAAc,CAAC,QAAQ,CAAC,SAAS,CAAC,WAAW,EAAE,IAAI;YACtF,mBAAmB,eAAe,EAAE,CAC3C,CAAC;KACL;IACD,0CAA0C;IAC1C,IAAI,eAAe,CAAC,cAAc,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,EAAE,IAAI,GAAG,CAAC,OAAO,EAAE,EAAE;QAC7E,0BAA0B;QAC1B,UAAU,CACN,gDAAgD;YAC5C,yCAAyC;YACzC,oBAAoB,eA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
-
"version": "2.
|
|
3
|
+
"version": "2.86.1",
|
|
4
4
|
"description": "pure nodejs OPCUA SDK - module -client",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"clean": "npx rimraf node_modules dist *.tsbuildinfo certificates",
|
|
@@ -20,43 +20,43 @@
|
|
|
20
20
|
"callbackify": "^1.1.0",
|
|
21
21
|
"chalk": "4.1.2",
|
|
22
22
|
"node-opcua-assert": "2.77.0",
|
|
23
|
-
"node-opcua-basic-types": "2.
|
|
24
|
-
"node-opcua-buffer-utils": "2.
|
|
25
|
-
"node-opcua-certificate-manager": "2.
|
|
26
|
-
"node-opcua-client-dynamic-extension-object": "2.
|
|
27
|
-
"node-opcua-common": "2.
|
|
23
|
+
"node-opcua-basic-types": "2.86.1",
|
|
24
|
+
"node-opcua-buffer-utils": "2.86.0",
|
|
25
|
+
"node-opcua-certificate-manager": "2.86.1",
|
|
26
|
+
"node-opcua-client-dynamic-extension-object": "2.86.1",
|
|
27
|
+
"node-opcua-common": "2.86.1",
|
|
28
28
|
"node-opcua-constants": "2.77.0",
|
|
29
|
-
"node-opcua-crypto": "^1.
|
|
30
|
-
"node-opcua-data-model": "2.
|
|
31
|
-
"node-opcua-data-value": "2.
|
|
32
|
-
"node-opcua-date-time": "2.
|
|
33
|
-
"node-opcua-debug": "2.
|
|
34
|
-
"node-opcua-extension-object": "2.
|
|
29
|
+
"node-opcua-crypto": "^2.1.2",
|
|
30
|
+
"node-opcua-data-model": "2.86.1",
|
|
31
|
+
"node-opcua-data-value": "2.86.1",
|
|
32
|
+
"node-opcua-date-time": "2.86.0",
|
|
33
|
+
"node-opcua-debug": "2.86.0",
|
|
34
|
+
"node-opcua-extension-object": "2.86.1",
|
|
35
35
|
"node-opcua-hostname": "2.77.0",
|
|
36
|
-
"node-opcua-nodeid": "2.
|
|
37
|
-
"node-opcua-object-registry": "2.
|
|
38
|
-
"node-opcua-pki": "^
|
|
39
|
-
"node-opcua-pseudo-session": "2.
|
|
40
|
-
"node-opcua-schemas": "2.
|
|
41
|
-
"node-opcua-secure-channel": "2.
|
|
42
|
-
"node-opcua-service-browse": "2.
|
|
43
|
-
"node-opcua-service-call": "2.
|
|
44
|
-
"node-opcua-service-discovery": "2.
|
|
45
|
-
"node-opcua-service-endpoints": "2.
|
|
46
|
-
"node-opcua-service-filter": "2.
|
|
47
|
-
"node-opcua-service-history": "2.
|
|
48
|
-
"node-opcua-service-query": "2.
|
|
49
|
-
"node-opcua-service-read": "2.
|
|
50
|
-
"node-opcua-service-register-node": "2.
|
|
51
|
-
"node-opcua-service-secure-channel": "2.
|
|
52
|
-
"node-opcua-service-session": "2.
|
|
53
|
-
"node-opcua-service-subscription": "2.
|
|
54
|
-
"node-opcua-service-translate-browse-path": "2.
|
|
55
|
-
"node-opcua-service-write": "2.
|
|
56
|
-
"node-opcua-status-code": "2.
|
|
57
|
-
"node-opcua-types": "2.
|
|
58
|
-
"node-opcua-utils": "2.
|
|
59
|
-
"node-opcua-variant": "2.
|
|
36
|
+
"node-opcua-nodeid": "2.86.0",
|
|
37
|
+
"node-opcua-object-registry": "2.86.0",
|
|
38
|
+
"node-opcua-pki": "^3.0.1",
|
|
39
|
+
"node-opcua-pseudo-session": "2.86.1",
|
|
40
|
+
"node-opcua-schemas": "2.86.1",
|
|
41
|
+
"node-opcua-secure-channel": "2.86.1",
|
|
42
|
+
"node-opcua-service-browse": "2.86.1",
|
|
43
|
+
"node-opcua-service-call": "2.86.1",
|
|
44
|
+
"node-opcua-service-discovery": "2.86.1",
|
|
45
|
+
"node-opcua-service-endpoints": "2.86.1",
|
|
46
|
+
"node-opcua-service-filter": "2.86.1",
|
|
47
|
+
"node-opcua-service-history": "2.86.1",
|
|
48
|
+
"node-opcua-service-query": "2.86.1",
|
|
49
|
+
"node-opcua-service-read": "2.86.1",
|
|
50
|
+
"node-opcua-service-register-node": "2.86.1",
|
|
51
|
+
"node-opcua-service-secure-channel": "2.86.1",
|
|
52
|
+
"node-opcua-service-session": "2.86.1",
|
|
53
|
+
"node-opcua-service-subscription": "2.86.1",
|
|
54
|
+
"node-opcua-service-translate-browse-path": "2.86.1",
|
|
55
|
+
"node-opcua-service-write": "2.86.1",
|
|
56
|
+
"node-opcua-status-code": "2.86.1",
|
|
57
|
+
"node-opcua-types": "2.86.1",
|
|
58
|
+
"node-opcua-utils": "2.86.0",
|
|
59
|
+
"node-opcua-variant": "2.86.1",
|
|
60
60
|
"once": "^1.4.0",
|
|
61
61
|
"thenify": "^3.3.1"
|
|
62
62
|
},
|
|
@@ -64,10 +64,10 @@
|
|
|
64
64
|
"@types/underscore": "^1.11.4",
|
|
65
65
|
"dequeue": "^1.0.5",
|
|
66
66
|
"mocha": "^10.1.0",
|
|
67
|
-
"node-opcua-address-space": "2.
|
|
68
|
-
"node-opcua-binary-stream": "2.
|
|
69
|
-
"node-opcua-factory": "2.
|
|
70
|
-
"node-opcua-leak-detector": "2.
|
|
67
|
+
"node-opcua-address-space": "2.86.1",
|
|
68
|
+
"node-opcua-binary-stream": "2.86.0",
|
|
69
|
+
"node-opcua-factory": "2.86.1",
|
|
70
|
+
"node-opcua-leak-detector": "2.86.0",
|
|
71
71
|
"node-opcua-nodesets": "2.77.0",
|
|
72
72
|
"should": "^13.2.3",
|
|
73
73
|
"sinon": "^14.0.2",
|
|
@@ -93,5 +93,5 @@
|
|
|
93
93
|
"internet of things"
|
|
94
94
|
],
|
|
95
95
|
"homepage": "http://node-opcua.github.io/",
|
|
96
|
-
"gitHead": "
|
|
96
|
+
"gitHead": "389ba18585ff4b62f6fee58b69bd871a8e6b0dff"
|
|
97
97
|
}
|
|
@@ -2,7 +2,6 @@ import * as chalk from "chalk";
|
|
|
2
2
|
import { AttributeIds } from "node-opcua-data-model";
|
|
3
3
|
import { NodeId } from "node-opcua-nodeid";
|
|
4
4
|
import { IBasicSession } from "node-opcua-pseudo-session";
|
|
5
|
-
import { StatusCodes } from "node-opcua-status-code";
|
|
6
5
|
import { DataType, Variant, VariantLike } from "node-opcua-variant";
|
|
7
6
|
|
|
8
7
|
/**
|
|
@@ -17,7 +16,7 @@ export async function dumpEvent(session: IBasicSession, fields: string[], eventF
|
|
|
17
16
|
attributeId: AttributeIds.BrowseName,
|
|
18
17
|
nodeId
|
|
19
18
|
});
|
|
20
|
-
if (dataValue.statusCode
|
|
19
|
+
if (dataValue.statusCode.isGood()) {
|
|
21
20
|
const browseName = dataValue.value.value.name!;
|
|
22
21
|
return browseName;
|
|
23
22
|
} else {
|
|
@@ -76,7 +76,7 @@ export function callConditionRefresh(subscription: ClientSubscription, callback?
|
|
|
76
76
|
result = result!;
|
|
77
77
|
|
|
78
78
|
// istanbul ignore next
|
|
79
|
-
if (result.statusCode
|
|
79
|
+
if (result.statusCode.isNotGood()) {
|
|
80
80
|
warningLog(new CallMethodRequest(methodToCall).toString());
|
|
81
81
|
return innerCallback(new Error("Error " + result.statusCode.toString()));
|
|
82
82
|
}
|
|
@@ -129,7 +129,7 @@ export class ClientMonitoredItemToolbox {
|
|
|
129
129
|
const res = response.results[0];
|
|
130
130
|
|
|
131
131
|
/* istanbul ignore next */
|
|
132
|
-
if (response.results.length === 1 && res.statusCode
|
|
132
|
+
if (response.results.length === 1 && res.statusCode.isNotGood()) {
|
|
133
133
|
return callback(new Error("Error" + res.statusCode.toString()));
|
|
134
134
|
}
|
|
135
135
|
callback(null, response.results);
|
|
@@ -158,7 +158,7 @@ export class ClientSessionKeepAliveManager extends EventEmitter implements Clien
|
|
|
158
158
|
return;
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
-
if (dataValue.statusCode
|
|
161
|
+
if (dataValue.statusCode.isGood()) {
|
|
162
162
|
const newState = dataValue.value.value as ServerState;
|
|
163
163
|
// istanbul ignore next
|
|
164
164
|
if (newState !== this.lastKnownState && this.lastKnownState) {
|
package/source/client_utils.ts
CHANGED
|
@@ -83,7 +83,7 @@ export function readUAAnalogItem(session: ClientSession, nodeId: NodeIdLike, ...
|
|
|
83
83
|
const nodesToRead: ReadValueIdOptions[] = [];
|
|
84
84
|
|
|
85
85
|
function processProperty(browsePathResult: BrowsePathResult, propertyName: string) {
|
|
86
|
-
if (browsePathResult.statusCode
|
|
86
|
+
if (browsePathResult.statusCode.isGood()) {
|
|
87
87
|
browsePathResult.targets = browsePathResult.targets || [];
|
|
88
88
|
nodesToRead.push({
|
|
89
89
|
attributeId: AttributeIds.Value,
|
|
@@ -579,9 +579,10 @@ export class ClientBaseImpl extends OPCUASecureObject implements OPCUAClientBase
|
|
|
579
579
|
"the server certificate has changed, we need to retrieve server certificate again: ",
|
|
580
580
|
err.message
|
|
581
581
|
);
|
|
582
|
+
const oldServerCertificate = this.serverCertificate;
|
|
582
583
|
warningLog(
|
|
583
584
|
"old server certificate ",
|
|
584
|
-
|
|
585
|
+
oldServerCertificate ? makeSHA1Thumbprint(oldServerCertificate!).toString("hex") : "undefined"
|
|
585
586
|
);
|
|
586
587
|
// the server may have shut down the channel because its certificate
|
|
587
588
|
// has changed ....
|
|
@@ -590,7 +591,19 @@ export class ClientBaseImpl extends OPCUASecureObject implements OPCUAClientBase
|
|
|
590
591
|
if (err1) {
|
|
591
592
|
return _failAndRetry(err1, "Failing to fetch new server certificate", callback);
|
|
592
593
|
}
|
|
593
|
-
|
|
594
|
+
const newServerCertificate = this.serverCertificate!;
|
|
595
|
+
warningLog("new server certificate ", makeSHA1Thumbprint(newServerCertificate).toString("hex"));
|
|
596
|
+
|
|
597
|
+
const sha1Old = makeSHA1Thumbprint(oldServerCertificate!);
|
|
598
|
+
const sha1New = makeSHA1Thumbprint(newServerCertificate);
|
|
599
|
+
if (sha1Old === sha1New) {
|
|
600
|
+
warningLog("server certificate has not changed, but was expected to have changed");
|
|
601
|
+
return _failAndRetry(
|
|
602
|
+
new Error("Server Certificate not changed"),
|
|
603
|
+
"Failing to fetch new server certificate",
|
|
604
|
+
callback
|
|
605
|
+
);
|
|
606
|
+
}
|
|
594
607
|
this._internal_create_secure_channel(infiniteConnectionRetry, (err3?: Error | null) => {
|
|
595
608
|
if (err3) {
|
|
596
609
|
return _failAndRetry(err3, "trying to create new channel with new certificate", callback);
|
|
@@ -310,7 +310,7 @@ export class ClientMonitoredItemImpl extends EventEmitter implements ClientMonit
|
|
|
310
310
|
this.statusCode = monitoredItemResult.statusCode;
|
|
311
311
|
|
|
312
312
|
/* istanbul ignore else */
|
|
313
|
-
if (monitoredItemResult.statusCode
|
|
313
|
+
if (monitoredItemResult.statusCode.isGood()) {
|
|
314
314
|
this.result = monitoredItemResult;
|
|
315
315
|
this.monitoredItemId = monitoredItemResult.monitoredItemId;
|
|
316
316
|
this.monitoringParameters.samplingInterval = monitoredItemResult.revisedSamplingInterval;
|
|
@@ -348,7 +348,7 @@ export class ClientMonitoredItemImpl extends EventEmitter implements ClientMonit
|
|
|
348
348
|
public _after_create(monitoredItemResult: MonitoredItemCreateResult): void {
|
|
349
349
|
this._applyResult(monitoredItemResult);
|
|
350
350
|
|
|
351
|
-
if (this.statusCode
|
|
351
|
+
if (this.statusCode.isGood()) {
|
|
352
352
|
/**
|
|
353
353
|
* Notify the observers that the monitored item is now fully initialized.
|
|
354
354
|
* @event initialized
|
|
@@ -366,7 +366,7 @@ export class ClientMonitoredItemImpl extends EventEmitter implements ClientMonit
|
|
|
366
366
|
}
|
|
367
367
|
|
|
368
368
|
public _terminate_and_emit(err?: Error): void {
|
|
369
|
-
if (this
|
|
369
|
+
if ((this as any)._terminated) {
|
|
370
370
|
return; // already terminated
|
|
371
371
|
}
|
|
372
372
|
if (err) {
|
|
@@ -380,8 +380,7 @@ export class ClientMonitoredItemImpl extends EventEmitter implements ClientMonit
|
|
|
380
380
|
*/
|
|
381
381
|
this.emit("terminated", err);
|
|
382
382
|
this.removeAllListeners();
|
|
383
|
-
|
|
384
|
-
|
|
383
|
+
|
|
385
384
|
// also remove from subscription
|
|
386
385
|
const clientHandle = this.monitoringParameters.clientHandle;
|
|
387
386
|
delete this.subscription.monitoredItems[clientHandle];
|
|
@@ -520,7 +520,7 @@ export class ClientSessionImpl extends EventEmitter implements ClientSession {
|
|
|
520
520
|
* ```javascript
|
|
521
521
|
* session.readVariableValue("ns=2;s=Furnace_1.Temperature",function(err,dataValue) {
|
|
522
522
|
* if(err) { return callback(err); }
|
|
523
|
-
* if (dataValue.
|
|
523
|
+
* if (dataValue.isGood()) {
|
|
524
524
|
* }
|
|
525
525
|
* console.log(dataValue.toString());
|
|
526
526
|
* callback();
|
|
@@ -1091,7 +1091,7 @@ export class ClientSessionImpl extends EventEmitter implements ClientSession {
|
|
|
1091
1091
|
*
|
|
1092
1092
|
* ``` javascript
|
|
1093
1093
|
* session.readAllAttributes("ns=2;s=Furnace_1.Temperature",function(err,data) {
|
|
1094
|
-
* if(data.statusCode
|
|
1094
|
+
* if(data.statusCode.isGood()) {
|
|
1095
1095
|
* console.log(" nodeId = ",data.nodeId.toString());
|
|
1096
1096
|
* console.log(" browseName = ",data.browseName.toString());
|
|
1097
1097
|
* console.log(" description = ",data.description.toString());
|
|
@@ -2099,7 +2099,7 @@ export class ClientSessionImpl extends EventEmitter implements ClientSession {
|
|
|
2099
2099
|
}
|
|
2100
2100
|
|
|
2101
2101
|
/* istanbul ignore next */
|
|
2102
|
-
if (dataValue.statusCode
|
|
2102
|
+
if (dataValue.statusCode.isNotGood()) {
|
|
2103
2103
|
return callback(new Error("readNamespaceArray : " + dataValue.statusCode.toString()));
|
|
2104
2104
|
}
|
|
2105
2105
|
assert(dataValue.value.value instanceof Array);
|
|
@@ -428,7 +428,7 @@ export class ClientSubscriptionImpl extends EventEmitter implements ClientSubscr
|
|
|
428
428
|
if (!statusCode) {
|
|
429
429
|
return callback(new Error("Internal Error"));
|
|
430
430
|
}
|
|
431
|
-
if (statusCode
|
|
431
|
+
if (statusCode.isNotGood()) {
|
|
432
432
|
return callback(null, statusCode);
|
|
433
433
|
}
|
|
434
434
|
callback(null, StatusCodes.Good);
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
// tslint:disable:no-empty
|
|
7
7
|
|
|
8
8
|
import * as crypto from "crypto";
|
|
9
|
+
import { createPublicKey } from "crypto";
|
|
9
10
|
import { callbackify } from "util";
|
|
10
11
|
import * as async from "async";
|
|
11
12
|
import * as chalk from "chalk";
|
|
@@ -17,13 +18,14 @@ import {
|
|
|
17
18
|
exploreCertificate,
|
|
18
19
|
extractPublicKeyFromCertificateSync,
|
|
19
20
|
Nonce,
|
|
21
|
+
PrivateKey,
|
|
20
22
|
PrivateKeyPEM,
|
|
21
23
|
toPem
|
|
22
24
|
} from "node-opcua-crypto";
|
|
23
25
|
|
|
24
26
|
import { LocalizedText } from "node-opcua-data-model";
|
|
25
27
|
import { checkDebugFlag, make_debugLog, make_errorLog, make_warningLog } from "node-opcua-debug";
|
|
26
|
-
import { extractFullyQualifiedDomainName
|
|
28
|
+
import { extractFullyQualifiedDomainName } from "node-opcua-hostname";
|
|
27
29
|
import { ClientSecureChannelLayer, computeSignature, fromURI, getCryptoFactory, SecurityPolicy } from "node-opcua-secure-channel";
|
|
28
30
|
import { ApplicationDescriptionOptions, ApplicationType, EndpointDescription, UserTokenType } from "node-opcua-service-endpoints";
|
|
29
31
|
import { MessageSecurityMode, UserTokenPolicy } from "node-opcua-service-secure-channel";
|
|
@@ -31,8 +33,6 @@ import {
|
|
|
31
33
|
ActivateSessionRequest,
|
|
32
34
|
ActivateSessionResponse,
|
|
33
35
|
AnonymousIdentityToken,
|
|
34
|
-
CloseSessionRequest,
|
|
35
|
-
CloseSessionResponse,
|
|
36
36
|
CreateSessionRequest,
|
|
37
37
|
CreateSessionResponse,
|
|
38
38
|
UserNameIdentityToken,
|
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
import { CallbackT, StatusCode, StatusCodes } from "node-opcua-status-code";
|
|
42
42
|
import { ErrorCallback, Callback } from "node-opcua-status-code";
|
|
43
43
|
|
|
44
|
-
import {
|
|
44
|
+
import { SignatureDataOptions, UserIdentityToken } from "node-opcua-types";
|
|
45
45
|
import { isNullOrUndefined, matchUri } from "node-opcua-utils";
|
|
46
46
|
|
|
47
47
|
import { ClientSession } from "../client_session";
|
|
@@ -132,7 +132,7 @@ interface X509TokenAndSignature {
|
|
|
132
132
|
function createX509IdentityToken(
|
|
133
133
|
context: IdentityTokenContext,
|
|
134
134
|
certificate: Certificate,
|
|
135
|
-
privateKey:
|
|
135
|
+
privateKey: PrivateKey
|
|
136
136
|
): X509TokenAndSignature {
|
|
137
137
|
const endpoint = context.endpoint;
|
|
138
138
|
assert(endpoint instanceof EndpointDescription);
|
|
@@ -250,7 +250,7 @@ function createUserNameIdentityToken(
|
|
|
250
250
|
|
|
251
251
|
assert(serverCertificate instanceof Buffer);
|
|
252
252
|
serverCertificate = toPem(serverCertificate, "CERTIFICATE");
|
|
253
|
-
const publicKey = extractPublicKeyFromCertificateSync(serverCertificate);
|
|
253
|
+
const publicKey = createPublicKey(extractPublicKeyFromCertificateSync(serverCertificate));
|
|
254
254
|
|
|
255
255
|
const serverNonce: Nonce = session.serverNonce || Buffer.alloc(0);
|
|
256
256
|
assert(serverNonce instanceof Buffer);
|
|
@@ -1236,7 +1236,7 @@ export class OPCUAClientImpl extends ClientBaseImpl implements OPCUAClient {
|
|
|
1236
1236
|
|
|
1237
1237
|
case UserTokenType.Certificate: {
|
|
1238
1238
|
const certificate = userIdentityInfo.certificateData;
|
|
1239
|
-
const privateKey = userIdentityInfo.privateKey;
|
|
1239
|
+
const privateKey = crypto.createPrivateKey(userIdentityInfo.privateKey);
|
|
1240
1240
|
({ userIdentityToken, userTokenSignature } = createX509IdentityToken(context, certificate, privateKey));
|
|
1241
1241
|
break;
|
|
1242
1242
|
}
|
package/source/reconnection.ts
CHANGED
|
@@ -8,7 +8,7 @@ import * as chalk from "chalk";
|
|
|
8
8
|
import { assert } from "node-opcua-assert";
|
|
9
9
|
import { checkDebugFlag, make_debugLog, make_errorLog, make_warningLog } from "node-opcua-debug";
|
|
10
10
|
import { TransferSubscriptionsRequest, TransferSubscriptionsResponse } from "node-opcua-service-subscription";
|
|
11
|
-
import { CallbackT, StatusCodes } from "node-opcua-status-code";
|
|
11
|
+
import { CallbackT, StatusCode, StatusCodes } from "node-opcua-status-code";
|
|
12
12
|
import { ErrorCallback } from "node-opcua-status-code";
|
|
13
13
|
import { CloseSessionRequest } from "node-opcua-types";
|
|
14
14
|
|
|
@@ -320,7 +320,7 @@ function repair_client_session_by_recreating_a_new_session(
|
|
|
320
320
|
// those one need to be recreated and repaired ....
|
|
321
321
|
for (let i = 0; i < results.length; i++) {
|
|
322
322
|
const statusCode = results[i].statusCode;
|
|
323
|
-
if (statusCode
|
|
323
|
+
if (statusCode.equals(StatusCodes.BadSubscriptionIdInvalid)) {
|
|
324
324
|
// repair subscription
|
|
325
325
|
debugLog(
|
|
326
326
|
chalk.red(" WARNING SUBSCRIPTION "),
|
|
@@ -41,7 +41,7 @@ export function readHistoryServerCapabilities(
|
|
|
41
41
|
if (!result) {
|
|
42
42
|
return callback(new Error("Internal Error"));
|
|
43
43
|
}
|
|
44
|
-
if (result.statusCode
|
|
44
|
+
if (result.statusCode.isNotGood()) {
|
|
45
45
|
return callback(new Error("StatusCode = " + result.statusCode.toString()));
|
|
46
46
|
}
|
|
47
47
|
|
|
@@ -89,7 +89,7 @@ export function readHistoryServerCapabilities(
|
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
const nodeIds = results.map((innerResult: BrowsePathResult) =>
|
|
92
|
-
innerResult.statusCode
|
|
92
|
+
innerResult.statusCode.isGood() && innerResult.targets
|
|
93
93
|
? innerResult.targets[0].targetId
|
|
94
94
|
: new NodeId()
|
|
95
95
|
);
|
package/source/verify.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createPrivateKey } from "crypto";
|
|
1
2
|
import { OPCUACertificateManager } from "node-opcua-certificate-manager";
|
|
2
3
|
import { OPCUASecureObject } from "node-opcua-common";
|
|
3
4
|
|
|
@@ -126,7 +127,7 @@ export async function performCertificateSanityCheck(
|
|
|
126
127
|
): Promise<void> {
|
|
127
128
|
// verify that certificate is matching private key, and inform the developper if not
|
|
128
129
|
const certificate = this.getCertificate();
|
|
129
|
-
const privateKey =
|
|
130
|
+
const privateKey = this.getPrivateKey();
|
|
130
131
|
//
|
|
131
132
|
if (!publicKeyAndPrivateKeyMatches(certificate, privateKey)) {
|
|
132
133
|
errorLog("[NODE-OPCUA-E01] Configuration error : the certificate and the private key do not match !");
|