BadSecureChannelClosed error|Miscellaneous|Forum|OPC Foundation

Avatar
Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
Lost password?
sp_Feed sp_PrintTopic sp_TopicIcon
BadSecureChannelClosed error
Avatar
Agata Gabryel
New Member
Members
Forum Posts: 1
Member Since:
02/14/2022
sp_UserOfflineSmall Offline
1
02/14/2022 - 04:30
sp_Permalink sp_Print

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!

Forum Timezone: America/Phoenix
Most Users Ever Online: 510
Currently Online:
Guest(s) 23
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 10
Topics: 1434
Posts: 4854