node-opcua-client 2.102.0 → 2.104.0
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 +6 -3
- package/dist/alarms_and_conditions/client_alarm_tools_dump_event.js.map +1 -1
- package/dist/alarms_and_conditions/client_tools.js +24 -1
- package/dist/alarms_and_conditions/client_tools.js.map +1 -1
- package/dist/client_base.d.ts +5 -1
- package/dist/client_base.js +1 -1
- package/dist/client_base.js.map +1 -1
- package/dist/client_monitored_item_toolbox.js +5 -2
- package/dist/client_monitored_item_toolbox.js.map +1 -1
- package/dist/client_session_keepalive_manager.d.ts +1 -1
- package/dist/client_session_keepalive_manager.js +10 -6
- package/dist/client_session_keepalive_manager.js.map +1 -1
- package/dist/client_subscription.js +1 -1
- package/dist/client_subscription.js.map +1 -1
- package/dist/index.js +14 -2
- package/dist/index.js.map +1 -1
- package/dist/opcua_client.d.ts +0 -38
- package/dist/opcua_client.js.map +1 -1
- package/dist/private/client_base_impl.d.ts +2 -0
- package/dist/private/client_base_impl.js +78 -34
- package/dist/private/client_base_impl.js.map +1 -1
- package/dist/private/client_publish_engine.js +39 -13
- package/dist/private/client_publish_engine.js.map +1 -1
- package/dist/private/client_session_impl.d.ts +1 -1
- package/dist/private/client_session_impl.js +26 -23
- package/dist/private/client_session_impl.js.map +1 -1
- package/dist/private/client_subscription_impl.js +45 -19
- package/dist/private/client_subscription_impl.js.map +1 -1
- package/dist/private/opcua_client_impl.js +32 -6
- package/dist/private/opcua_client_impl.js.map +1 -1
- package/dist/reconnection.js +52 -26
- package/dist/reconnection.js.map +1 -1
- package/dist/tools/findservers.js +24 -1
- package/dist/tools/findservers.js.map +1 -1
- package/dist/tools/read_history_server_capabilities.js.map +1 -1
- package/dist/verify.d.ts +1 -1
- package/dist/verify.js +9 -8
- package/dist/verify.js.map +1 -1
- package/package.json +48 -48
- package/source/alarms_and_conditions/client_alarm_tools_dump_event.ts +1 -1
- package/source/client_base.ts +5 -1
- package/source/client_monitored_item_toolbox.ts +1 -1
- package/source/client_session_keepalive_manager.ts +7 -5
- package/source/opcua_client.ts +0 -46
- package/source/private/client_base_impl.ts +46 -26
- package/source/private/client_publish_engine.ts +1 -1
- package/source/private/client_session_impl.ts +4 -4
- package/source/private/client_subscription_impl.ts +1 -1
- package/source/private/opcua_client_impl.ts +2 -3
- package/source/reconnection.ts +1 -1
- package/source/tools/read_history_server_capabilities.ts +6 -0
- package/source/verify.ts +9 -8
|
@@ -9,7 +9,7 @@ import * as crypto from "crypto";
|
|
|
9
9
|
import { createPublicKey } from "crypto";
|
|
10
10
|
import { callbackify } from "util";
|
|
11
11
|
import * as async from "async";
|
|
12
|
-
import
|
|
12
|
+
import chalk from "chalk";
|
|
13
13
|
|
|
14
14
|
import { assert } from "node-opcua-assert";
|
|
15
15
|
import { createFastUninitializedBuffer } from "node-opcua-buffer-utils";
|
|
@@ -19,7 +19,6 @@ import {
|
|
|
19
19
|
extractPublicKeyFromCertificateSync,
|
|
20
20
|
Nonce,
|
|
21
21
|
PrivateKey,
|
|
22
|
-
PrivateKeyPEM,
|
|
23
22
|
toPem
|
|
24
23
|
} from "node-opcua-crypto";
|
|
25
24
|
|
|
@@ -1049,7 +1048,7 @@ export class OPCUAClientImpl extends ClientBaseImpl implements OPCUAClient {
|
|
|
1049
1048
|
session.serverNonce = response.serverNonce;
|
|
1050
1049
|
session.lastResponseReceivedTime = new Date();
|
|
1051
1050
|
if (this.keepSessionAlive) {
|
|
1052
|
-
session.startKeepAliveManager();
|
|
1051
|
+
session.startKeepAliveManager(this.keepAliveInterval);
|
|
1053
1052
|
}
|
|
1054
1053
|
session.userIdentityInfo = userIdentityInfo;
|
|
1055
1054
|
return callback(null, session);
|
package/source/reconnection.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
// tslint:disable:only-arrow-functions
|
|
6
6
|
import * as async from "async";
|
|
7
|
-
import
|
|
7
|
+
import 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";
|
|
@@ -55,18 +55,24 @@ export function readHistoryServerCapabilities(
|
|
|
55
55
|
const properties = [
|
|
56
56
|
"AccessHistoryDataCapability",
|
|
57
57
|
"AccessHistoryEventsCapability",
|
|
58
|
+
|
|
58
59
|
"DeleteAtTimeCapability",
|
|
59
60
|
"DeleteRawCapability",
|
|
60
61
|
"DeleteEventCapability",
|
|
62
|
+
|
|
61
63
|
"InsertAnnotationCapability",
|
|
62
64
|
"InsertDataCapability",
|
|
63
65
|
"InsertEventCapability",
|
|
66
|
+
|
|
64
67
|
"ReplaceDataCapability",
|
|
65
68
|
"ReplaceEventCapability",
|
|
69
|
+
|
|
66
70
|
"UpdateDataCapability",
|
|
67
71
|
"UpdateEventCapability",
|
|
72
|
+
|
|
68
73
|
"MaxReturnDataValues",
|
|
69
74
|
"MaxReturnEventValues",
|
|
75
|
+
|
|
70
76
|
"AggregateFunctions/AnnotationCount",
|
|
71
77
|
"AggregateFunctions/Average",
|
|
72
78
|
"AggregateFunctions/Count",
|
package/source/verify.ts
CHANGED
|
@@ -86,6 +86,7 @@ export function verifyIsOPCUAValidCertificate(
|
|
|
86
86
|
`see https://reference.opcfoundation.org/v104/Core/docs/Part6/6.2.2/\n` +
|
|
87
87
|
`certificateFile = ${certificateFile}`
|
|
88
88
|
);
|
|
89
|
+
warningLog(`keyUsage = ${JSON.stringify(keyUsage, null, " ")}`);
|
|
89
90
|
}
|
|
90
91
|
}
|
|
91
92
|
const extKeyUsage = certificateInfo.tbsCertificate.extensions?.extKeyUsage;
|
|
@@ -120,21 +121,21 @@ export function verifyIsOPCUAValidCertificate(
|
|
|
120
121
|
}
|
|
121
122
|
|
|
122
123
|
export async function performCertificateSanityCheck(
|
|
123
|
-
|
|
124
|
+
secureObject: OPCUASecureObject,
|
|
124
125
|
serverOrClient: "server" | "client",
|
|
125
126
|
certificateManager: OPCUACertificateManager,
|
|
126
127
|
applicationUri: string
|
|
127
128
|
): Promise<void> {
|
|
128
|
-
// verify that certificate is matching private key, and inform the
|
|
129
|
-
const certificate =
|
|
130
|
-
const privateKey =
|
|
129
|
+
// verify that certificate is matching private key, and inform the developer if not
|
|
130
|
+
const certificate = secureObject.getCertificate();
|
|
131
|
+
const privateKey = secureObject.getPrivateKey();
|
|
131
132
|
//
|
|
132
133
|
if (!publicKeyAndPrivateKeyMatches(certificate, privateKey)) {
|
|
133
134
|
errorLog("[NODE-OPCUA-E01] Configuration error : the certificate and the private key do not match !");
|
|
134
135
|
errorLog(" please check the configuration of the OPCUA Server");
|
|
135
|
-
errorLog(" privateKey= ",
|
|
136
|
+
errorLog(" privateKey= ", secureObject.privateKeyFile);
|
|
136
137
|
errorLog(" certificateManager.privateKey= ", certificateManager.privateKey);
|
|
137
|
-
errorLog(" certificateFile= ",
|
|
138
|
+
errorLog(" certificateFile= ", secureObject.certificateFile);
|
|
138
139
|
throw new Error(
|
|
139
140
|
"[NODE-OPCUA-E01] Configuration error : the certificate and the private key do not match ! please fix your configuration"
|
|
140
141
|
);
|
|
@@ -154,8 +155,8 @@ export async function performCertificateSanityCheck(
|
|
|
154
155
|
const status = await certificateManager.verifyCertificateAsync(certificate);
|
|
155
156
|
|
|
156
157
|
if (status !== "Good") {
|
|
157
|
-
warningLog("[NODE-OPCUA-W04] Warning: the certificate status is = ", status, " file = ",
|
|
158
|
+
warningLog("[NODE-OPCUA-W04] Warning: the certificate status is = ", status, " file = ", secureObject.certificateFile);
|
|
158
159
|
}
|
|
159
160
|
|
|
160
|
-
verifyIsOPCUAValidCertificate(certificate,
|
|
161
|
+
verifyIsOPCUAValidCertificate(certificate, secureObject.certificateFile, serverOrClient, applicationUri);
|
|
161
162
|
}
|