1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 <2024> 2025 | Index | 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 <2024> 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: OPCUA SSL problem |
From: | Ralph Lange via Tech-talk <tech-talk at aps.anl.gov> |
To: | EPICS Tech Talk <tech-talk at aps.anl.gov> |
Date: | Thu, 3 Oct 2024 15:08:37 +0200 |
I am using EPICS OPCUA module built with Open62541 v1.3.10 and OpenSSL, running on Rocky Linux 9. It is mostly used to connect to B&R PLCs which have self-signed server certificate and then it runs without problems.
I need to communicate also with another server which has certificate signed by a certification authority. The authority uses a self-signed certificate. I cannot get this communication working in any setup.
This is the output of EPICS shell:
[root@fct-deploy20 iocopcua]# ./st.cmd
[... all good ...]
Session PLC: (connect) setting up PKI provider
Session PLC: (setupIdentity) setting Anonymous token
Session PLC: (setupSecurity) reading endpoints from opc.tcp://192.168.0.250:4840
[2024-10-02 12:46:41.331 (UTC+0000)] warn/client The configured ApplicationURI does not match the URI specified in the certificate for the SecurityPolicy http://opcfoundation.org/UA/SecurityPolicy#None
[2024-10-02 12:46:41.335 (UTC+0000)] info/server Reloading the trust-list
[2024-10-02 12:46:41.336 (UTC+0000)] info/server Reloading the issuer-list
[2024-10-02 12:46:41.336 (UTC+0000)] info/server Reloading the revocation-list
[2024-10-02 12:46:41.336 (UTC+0000)] warn/channel Connection 8 | SecureChannel 0 | Receiving the response failed with StatusCode BadCertificateUntrusted
[2024-10-02 12:46:41.336 (UTC+0000)] info/client Client Status: ChannelState: Closed, SessionState: Closed, ConnectStatus: BadConnectionClosed
Session PLC: (setupSecurity) UaDiscovery::getEndpoints from opc.tcp://192.168.0.250:4840 failed with status BadConnectionClosed
OPC UA session PLC: security discovery and setup failed with status cantConnect
We used tcpdump to capture TCP communication, it shows TCP is closed by client after receiving OpenSecureChannelResponse from the server.
We have certificate of both the authority and the server and crl of the authority. This is a list of steps which we tried and still got BadCertificateUntrusted:
· Putting server certificate into PKI/trusted/certs
· Putting CA certificate into PKI/trusted/certs and crl into PKI/trusted/crl
· Putting CA certificate into PKI/issuers/certs and crl into PKI/issuers/crl
· Combinations of all of the above
· Adding certificates to the system
· Running with sec-mode=None and commenting out opcuaSetupPKI command
We also tried running the IOC with strace to see system calls and noticed that PKI/trusted/crl directory was not opened during IOC startup.
We have used openssl verify to check the server certificate against the CA with OK result.
And perhaps most importantly, we can connect to the server with UAExpert without any issues when we use the same certificates.
Do you have any experience with this behavior and any advice how to fix it or even where to look for the problem?