使用端点 (opc.tcp://{serverIP:port}/OPCUASserver) 连接到 OPCUA 服务器时,我收到一个我不知道如何解释的错误。
我创建一个 OPCUAClient 使用:
let client = OPCUAClient.create(clientOptions);
然后调用connect
try {
await client.connect(connection.endpoint);
} catch (err) {
console.log('opcuaClient: connection error: ', err);
这是打印到控制台的日志消息:
opcuaClient: connection error: Error: Invalid position : buf.length=0 pos =0
at readTag (/node_js/app/node_modules/node-opcua-crypto/dist/source/asn1.js:36:15)
at Object.split_der (/node_js/app/node_modules/node-opcua-crypto/dist/source/crypto_explore_certificate.js:569:47)
at OPCUAClientImpl.getCertificate (/node_js/app/node_modules/node-opcua-common/dist/opcua_secure_object.js:37:52)
at OPCUAClientImpl.<anonymous> (/node_js/app/node_modules/node-opcua-client/dist/verify.js:106:34)
at Generator.next (<anonymous>)
at /node_js/app/node_modules/node-opcua-client/dist/verify.js:8:71
at new Promise (<anonymous>)
at __awaiter (/node_js/app/node_modules/node-opcua-client/dist/verify.js:4:12)
at OPCUAClientImpl.performCertificateSanityCheck (/node_js/app/node_modules/node-opcua-client/dist/verify.js:104:12)
at OPCUAClientImpl.<anonymous> (/node_js/app/node_modules/node-opcua-client/dist/private/client_base_impl.js:569:62)
at Generator.next (<anonymous>)
at /node_js/app/node_modules/node-opcua-client/dist/private/client_base_impl.js:8:71
at new Promise (<anonymous>)
at __awaiter (/node_js/app/node_modules/node-opcua-client/dist/private/client_base_impl.js:4:12)
at /node_js/app/node_modules/node-opcua-client/dist/private/client_base_impl.js:566:122
at Object.<anonymous> (/node_js/app/node_modules/@ster5/global-mutex/dist/source/index.js:194:26)
我不确定这个错误是什么意思。
谢谢!