关于OPCUA 协议 Bad Certificate Untrusted问题的解决

背景:

在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.

create_secure_channel.png

Trusting the client’s certificate is a manual step on the server. Usually, a server administrator has to move the client certificate from the list of rejected to the list of trusted certificates.
client_certificate_rejected.png

在windows中

C:\ProgramData\UnifiedAutomation\UaSdkCppBundleEval\pkiserver\rejected

拷贝****.der到

C:\ProgramData\UnifiedAutomation\UaSdkCppBundleEval\pkiserver\trusted\certs



  • 4
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 10
    评论
ssslerr_peer_cert_untrusted是一个错误代码,它通常出现在网络安全相关的场景中,表示SSL连接过程中对等证书未被信任。 在SSL/TLS协议中,对等证书用于验证服务器的身份。当一个客户端尝试与服务器建立SSL连接时,服务器会将自己的证书发送给客户端。客户端会检查证书的有效性,以确保与服务器通信的安全性。如果客户端发现对等证书未被信任,就会引发ssslerr_peer_cert_untrusted错误。 这个错误通常是由以下几种情况引起的: 1. 证书颁发机构未被客户端信任:客户端使用了一个不被信任的证书颁发机构签发的证书。解决问题的方法是将证书颁发机构的根证书添加到客户端的信任列表中。 2. 证书已过期:证书颁发机构颁发的证书有一个有效期限。如果证书已过期,客户端会认为它不再可信。解决问题的方法是从服务器获得一个新的有效证书。 3. SSL/TLS协议版本或加密算法不被支持:某些老旧的SSL/TLS协议版本或加密算法已被认为不安全并停止被支持。如果服务器使用了这些不被支持的版本或算法,客户端会认为对等证书不可信任,从而引发错误。解决问题的方法是更新服务器的SSL/TLS配置,使用支持的版本和算法。 对于ssslerr_peer_cert_untrusted错误,需要仔细检查证书的有效性和可信任性,并根据具体情况采取相应的解决措施,以确保SSL连接的安全性。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 10
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值