2

When connecting to an OPCUA Server using an endpoint (opc.tcp://{serverIP:port}/OPCUASserver), I am getting an error that I do not know how to interpret.

I create an OPCUAClient using:

let client = OPCUAClient.create(clientOptions);

Then call connect

try {
    await client.connect(connection.endpoint);
} catch (err) {
    console.log('opcuaClient: connection error: ', err); 

Here is the log message that gets printed to console:

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)

I am not sure what this error means.
Thanks!

0 Answers0