02/14/2022
Hello.
I am trying to connect to OPC UA with user identity. I use Advosol control to connect to OPC server (Siemens).
Connection without security doesn't seem to be problematic.
In log file I can see informations:
15464 - 14.02.2022 12:23:36.527 Could not create a Session with the UA Server. Error establishing a connection. BadRequestTimeout 'Error establishing a connection.'
15464 - 14.02.2022 12:23:36.529 Unexpected error during OnReadComplete, BadTcpInternalError 'BeginReceive failed.'
I am using the BGServer (as _bgSrv) class and configuration as below:
public override void SetWindow(UIElement window)
{
base.SetWindow(window);
OpcServer.UaAppConfigFileAutoCreate = "Test";
OpcServer.onNotifyUntrustedCertificate += OnNotifyUntrustedCertificate;
_bgSrv = new BGServer(window);
_bgSrv.OpcNetServer.CertificateDomainMustMatch = false;
_bgSrv.OpcNetServer.UaConfigFileName = Directory.GetCurrentDirectory() + "\\" + ConfigFileName;
_bgCore = new BGCore(window);
}private static int OnNotifyUntrustedCertificate(string subjectName)
{
return 1;
}
and connection:
if (!string.IsNullOrEmpty(userName))
{
var host = new Host { UserName = userName, Password = password };
_userName = userName;
_password = password;_bgSrv.Connect(host, path, null, OnConnectCompleted);
return;
}_bgSrv.OpcNetServer.UaAccessWithoutSecurityPreferred = true;
_bgSrv.Connect(path, null, OnConnectCompleted);
I will be gratefull for any kind of information.
Best regards!
1 Guest(s)