Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
UaClient.getSupportedSecurityModes() returns 0 for Beckhoff OPCUA
September 17, 2015
8:13, EEST
Avatar
gjevremovic
Member
Members
Forum Posts: 49
Member Since:
January 30, 2014
sp_UserOfflineSmall Offline

Hi,

I have next issue with Beckhoff OPCUA server (version 3.2.1 (newest) for TC3) and Prosys Java Client SDK 2.2.0-552 (same with previous Beckhoff server
and Prosys releases).
In my example Beckhoff server exposes 3 security modes but UaClient.getSupportedSecurityModes() method returns 0 elements (empty list).
With UAExpert client I am getting the list of supported security modes of Beckhoff OPCUA server without problems.
The same code UaClient.getSupportedSecurityModes() returns from other servers (UADemo, B&R, …) the list of security modes as expected.
What do you think is it server side or client side bug?

Best regards,
Goran

September 17, 2015
15:35, EEST
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1010
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

The method is comparing the endpointUrls of the endpoint descriptions to the one defined by getUri(). So in case these differ, it won’t provide any matches.

I am not quite sure if that verification is actually necessary; in practice we might be able to accept any endpoints that we get from discoverEndpoints().

Which kind of endpointUrls do they (getup() vs. discoverEndpoints()) provide to you?

September 18, 2015
7:22, EEST
Avatar
gjevremovic
Member
Members
Forum Posts: 49
Member Since:
January 30, 2014
sp_UserOfflineSmall Offline

Hi Aro,

“in practice we might be able to accept any endpoints that we get from discoverEndpoints()”
Exactly. In previous message I didn’t write that I don’t have a problem to connect to Beckhoff OPC UA server. That works.
But problem is that I want to check before session is created which security modes are supported on server side.
One of parameters for connection that I have as entry parameter is security mode. So if security mode is not supported by server
request is “don’t do anything, just exit”.
In UaClient initialization algorithm I put security check where I have call UaClient.getSupportedSecurityModes() but it doesn’t work with Beckhoff.
Method returns empty list for Beckhoff so if I apply algorithm it will never reach the part of code which connect() to Beckhoff server.
With other servers it works. I have a list of endpoints (here security modes) returned, I check the list and make decision before create session .
I also tried prosys sample client and its discovery and I get the same result. I think it is same result as in the background of getSupportedSecurityModes()
as you stated is discoverEndpoints() also.
That is tricky. I wonder why discoverEndpoints() works for Beckhoff in UAExpert demo client.
In UAExpert demo client I see the list of Beckhoff endpoints before I decide to connect.

Below are the logs. I can only see client successfully connects than fails to get endpoints for Beckhoff and
for other servers it is opposite. Client fails to connect than it successfully returns the endpoints.

Best regards,
Goran

>>>>>>>>>>> Here is the part of the log for Beckhoff:

Using SecurityPolicy http://opcfoundation.org/UA/Se…..olicy#None
09/17/2015 16:12:05.666 INFO Using an alternate endpoint URL ‘opc.tcp://IPC_6915_61:4840’ instead of the requested ‘opc.tcp://10.150.109.61:4840’
ServerState changed from Unknown to Running
ServerStatus: ServerStatusDataType: ServerStatusDataType
StartTime=09/17/15 09:54:10.3730000 GMT
CurrentTime=09/17/15 14:16:41.8520000 GMT
State=ServerState
name=Running
ordinal=0
BuildInfo=BuildInfo
ProductUri=urn:BeckhoffAutomation:TcOpcUaServer
ManufacturerName=Beckhoff Automation
ProductName=TcOpcUaServer
SoftwareVersion=2.1.0.28
BuildNumber=28
BuildDate=03/20/15 14:26:31.0000000 GMT
SecondsTillShutdown=0
ShutdownReason=null

*** Connected to: opc.tcp://10.150.109.61:4840
*** Current Node: Root: FolderType (ID: i=84)
——————————————————-
– Enter x to close client
——————————————————-
– Enter 0 to start discovery –
——————————————————-
# – Name – Type – Product – Application
0 – TcOpcUaServer@IPC_6915_61 – Server – urn:BeckhoffAutomation:TcOpcUaServer – urn:IPC_6915_61:BeckhoffAutomation:TcOpcUaServer:1
——————————————————-
– Enter client number to select that one
– Enter x to return to cancel
——————————————————-
0
Available endpoints:
# – URI – Security Mode – Security Policy – Transport Profile
Cannot discover Endpoints from URL opc.tcp://IPC_6915_61:4840: Failed to retrieve endpoints. The server is not available: opc.tcp://IPC_6915_61:4840

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>> Here is the part of the log for our prosys based server:

Using SecurityPolicy http://opcfoundation.org/UA/Se…..olicy#None
09/17/2015 16:05:08.511 ERROR The endpoint received from GetEndpoints is not in the endpoints of CreateSessionResponse. Endpoint=EndpointDescription: EndpointDescription
EndpointUrl=opc.tcp://10.150.109.69:4842
Server=null
ServerCertificate=null
SecurityMode=MessageSecurityMode
name=SignAndEncrypt
ordinal=3
SecurityPolicyUri=http://opcfoundation.org/UA/SecurityPolicy#Basic256
UserIdentityTokens=class org.opcfoundation.ua.core.UserTokenPolicy[1]
[0]=UserTokenPolicy
PolicyId=0
TokenType=UserTokenType
name=Anonymous
ordinal=0
IssuedTokenType=null
IssuerEndpointUrl=null
SecurityPolicyUri=null
TransportProfileUri=http://opcfoundation.org/UA-Profile/Transport/uatcp-uasc-uabinary
SecurityLevel=0

Invalid Endpoint: com.prosysopc.ua.client.InvalidServerEndpointException: Failed to create session channel to server: : opc.tcp://10.150.109.69:4842 [http://opcfoundation.org/UA/SecurityPolicy#None,None] ServiceResult=Bad_UnexpectedError (0x80010000) “An unexpected error occurred.”
Caused by: org.opcfoundation.ua.common.ServiceResultException: Bad_UnexpectedError (code=0x80010000, description=”The endpoint received from GetEndpoints is not in the endpoints of CreateSessionResponse”)
Endpoints supported by the server (by Discovery Service)
opc.tcp://10.150.109.69:4842 [http://opcfoundation.org/UA/SecurityPolicy#Basic256,SignAndEncrypt]
opc.tcp://10.150.109.69:4842 [http://opcfoundation.org/UA/SecurityPolicy#None,None]

*** NOT connected to: opc.tcp://10.150.109.69:4842
——————————————————-
– Enter x to close client
——————————————————-
– Enter 0 to start discovery –
——————————————————-
0
# – Name – Type – Product – Application
0 – My OPC-UA Server – Server – http://www.my.com/en/industrial-automation/ – urn:control:my:OpcUa
——————————————————-
– Enter client number to select that one
– Enter x to return to cancel
——————————————————-
0
Available endpoints:
# – URI – Security Mode – Security Policy – Transport Profile
0 – opc.tcp://10.150.109.69:4842 – SignAndEncrypt – Basic256 – uatcp-uasc-uabinary
1 – opc.tcp://10.150.109.69:4842 – None – None – uatcp-uasc-uabinary
——————————————————-

September 18, 2015
13:58, EEST
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1010
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

Yes, I think this explains the issue for the Beckhoff server:

INFO Using an alternate endpoint URL ‘opc.tcp://IPC_6915_61:4840′ instead of the requested ‘opc.tcp://10.150.109.61:4840′

But as I said, we should probably remove the filter for endpointUrl from getSupportedSecurityModes().

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
6 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 135

pramanj: 86

Francesco Zambon: 81

rocket science: 77

Ibrahim: 76

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

fred: 41

Member Stats:

Guest Posters: 0

Members: 682

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1467

Posts: 6261

Newest Members:

digitechroshni, LouieWreve, Kickbiche, karrimacvitie5, graciela2073, sagarchau, elviralangwell4, Donnavek, Eddiefauth, DonaldPooma

Moderators: Jouni Aro: 1010, Otso Palonen: 32, Tuomas Hiltunen: 5, Pyry: 1, Petri: 0, Bjarne Boström: 983, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Jimmy Ni: 26, Teppo Uimonen: 21, Markus Johansson: 42, Niklas Nurminen: 0, Matti Siponen: 321, Lusetti: 0, Ari-Pekka Soikkeli: 5

Administrators: admin: 1