I do create an opc-ua server like this:
var opcOptions = {
hostname: options.opcHost || "127.0.0.1",
port: options.opcPort || 4334,
resourcePath: options.opcName || "opcua",
buildInfo: {
productName: "OPCUA",
buildNumber: "0.1",
buildDate: new Date()
}
}
var server = new opcua.OPCUAServer(opcOptions);
But this will somehow spawn this error message in the console:
10:45:20.058Z :verify :48 [NODE-OPCUA-W06] The certificate subjectAltName does not match the server applicationUri
... Please regenerate a specific certificate that matches your server applicationUri
... certificate subjectAltName = urn:DESKTOP-6B2NRGG:NodeOPCUA-Server
... server applicationUri = urn:WIN01:NodeOPCUA-Server
... certificateFile = C:\Users\xxx\AppData\Roaming\node-opcua-default-nodejs\Config\PKI\own\certs\certificate.pem
Any idea on how to ignore/disable this message?
Turns out that node-opcua
does create some kind of certificate that is used for the server even if the server does not use tls. And after I run my software for the first time that certificate was created with the current hostname of my computer. Not long ago I did change my hostname so this certificate was not valid anymore.
The location of those files is C:\Users\user\AppData\Roaming\node-opcua-default-nodejs
.
Deleting the whole folder will prompt node-opcua to recreate them with all certificates at software start and after that the error message was gone.