背景:
在windows环境下运行UA demo server 和 UAexpert
https://www.unified-automation.com/downloads/opc-ua-development.html
https://www.unified-automation.com/downloads/opc-ua-clients.html
在建立安全连接时,出现
15:47:44.164 | Server Node | UaServerCpp@coolwaterld-DP ... | Connecting failed with error 'BadSecurityChecksFailed'
15:47:44.164 | Server Node | UaServerCpp@coolwaterld-DP ... | Error 'BadSecurityChecksFailed' was returned during OpenSecureChannel
15:47:44.139 | Server Node | UaServerCpp@coolwaterld-DP ... | Used UserTokenType: Anonymous
15:47:44.139 | Server Node | UaServerCpp@coolwaterld-DP ... | ApplicationUri: 'urn:coolwaterld-DP:UnifiedAutomation:UaServerCpp'
15:47:44.139 | Server Node | UaServerCpp@coolwaterld-DP ... | Security policy: 'http://opcfoundation.org/UA/SecurityPolicy#Basic256'
15:47:44.139 | Server Node | UaServerCpp@coolwaterld-DP ... | Endpoint: 'opc.tcp://coolwaterld-DP:48010'
表示需要服务器信任客户端
http://documentation.unified-automation.com/uasdkcpp/1.5.2/html/L2UaDiscoveryConnect.html
the client can attempt to create a secure channel with the server, sending along its Application Instance Certificate (including the public key of the client). This first connection attempt will be rejected, because the server doesn’t trust the client yet.
C:\ProgramData\UnifiedAutomation\UaSdkCppBundleEval\pkiserver\rejected
拷贝****.der到
C:\ProgramData\UnifiedAutomation\UaSdkCppBundleEval\pkiserver\trusted\certs