2

I'm using sample codes from documentation and I'm trying to connect to server using Prosys OPC UA Client. I have tried opcua-commander and integration objects opc ua client and it looks like server works just fine.

Here's what is happening:

  1. After entering endpointUrl, client adds to url -- urn:NodeOPCUA-Server-default.
  2. Client asks to specify security settings.
  3. Client asks to choose server - only 1 option and it's urn:NodeOPCUA-Server-default.

And it goes back to step 2 and 3 over and over.

If I just minimize prosys client without closing configuration after some time I get this info in terminal: Server: closing SESSION new ProsysOpcUaClient Session15 because of timeout = 300000 has expired without a keep alive \x1B[46mchannel = \x1B[49m ::ffff:10.10.13.2 port = 51824

I have tried this project and it works -> node-opcua-htmlpanel. What's missing in sample code then?

After opening debugger I have noticed that each Time I select security settings and hit OK, server_publish_engine reports:

server_publish_engine:179 Cencelling pending PublishRequest with statusCode BadSecureChannelClosed (0x80860000) length = 0

TwistedOwl
  • 1,195
  • 1
  • 17
  • 30

2 Answers2

2

This is due to a specific interoperability issue that was introduced in node-opcua@0.2.2. this will be fixed in next version of node-opcua. The resolution can be tracked here https://github.com/node-opcua/node-opcua/issues/464

Etienne
  • 16,249
  • 3
  • 26
  • 31
1

The issue has been handled at the Prosys OPC Forum:

The error happens because the server sends different EndpointDescriptions in GetEndpointsResponse and CreateSessionResponse.

In GetEndpoints, the returned EndpointDescriptions contain TransportProfileUri=http://opcfoundation.org/UA-Profile/Transport/uatcp-uasc-uabinary. In CreateSessionResponse, the corresponding TransportProfileUri is empty.

In principle, the server application is not working according to specification. The part 4 of the OPC UA specification states that “The Server shall return a set of EndpointDescriptions available for the serverUri specified in the request. … The Client shall verify this list with the list from a DiscoveryEndpoint if it used a DiscoveryEndpoint to fetch the EndpointDescriptions. It is recommended that Servers only include the server.applicationUri, endpointUrl, securityMode, securityPolicyUri, userIdentityTokens, transportProfileUri and securityLevel with all other parameters set to null. Only the recommended parameters shall be verified by the client.”

Jouni Aro
  • 2,099
  • 14
  • 30