admin管理员组文章数量:1291202
I am connecting to a Kepware OPCUA server using node-opcua. I will have more than one app that is connected to the server so I want to name the client certs. Here is the configuration I currently have where I am trying to give the cert a name but every time I connect the client name is "NodeOPCUA-Client". How do I name this cert so I can tell which one is trying to connect to my server?
const clientOptions = {
applicationName: "WBFNodeOPCUA-Client",
endpointMustExist: true,
securityMode: MessageSecurityMode.SignAndEncrypt,
securityPolicy: SecurityPolicy.Basic256Sha256,
connectionStrategy: {
maxRetry: 5,
initialDelay: 1000,
maxDelay: 10000
},
certificateManager: new OPCUACertificateManager({
automaticallyAcceptUnknownCertificate: true,
rootFolder: pkiDir,
keySize: 2048,
}),
};
let client = OPCUAClient.create(clientOptions);
I am connecting to a Kepware OPCUA server using node-opcua. I will have more than one app that is connected to the server so I want to name the client certs. Here is the configuration I currently have where I am trying to give the cert a name but every time I connect the client name is "NodeOPCUA-Client". How do I name this cert so I can tell which one is trying to connect to my server?
const clientOptions = {
applicationName: "WBFNodeOPCUA-Client",
endpointMustExist: true,
securityMode: MessageSecurityMode.SignAndEncrypt,
securityPolicy: SecurityPolicy.Basic256Sha256,
connectionStrategy: {
maxRetry: 5,
initialDelay: 1000,
maxDelay: 10000
},
certificateManager: new OPCUACertificateManager({
automaticallyAcceptUnknownCertificate: true,
rootFolder: pkiDir,
keySize: 2048,
}),
};
let client = OPCUAClient.create(clientOptions);
Share
Improve this question
asked Feb 13 at 18:38
Avi4nFLuAvi4nFLu
3462 silver badges15 bronze badges
1 Answer
Reset to default 1I figured it out thanks to this post.
"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."
I deleted this file and the next time I ran it created the certs where it was defined in my server file.
版权声明:本文标题:opc ua - How do I set the client name when connecting to a OPCUA Kepware server using node-opcua? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741510207a2382562.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论