Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. open62541
QtWS25 Last Chance

open62541

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 75 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    casina
    wrote last edited by
    #1

    I need to create a OPC-UA client connecting to a server using either a certificate or user/password authentication. While testing the connection with neither of these I got a BadAuthenticationToken error.
    In the case below encryption was disabled on endpoint 0, and the client was trying to connect without any kind of authentication.
    Screenshot_OPC-UA_BadAuthenticationToken.png
    Reading the library documentation it seems it may be an issue with the encryption...

    After that I tried adding encryption to the client, attempting to connect to the other endpoints, but my linker retun linker errors when linking the openssl libraries libssl.lib and the libcrypto.lib. I already tried manually adding these libraries to the linker but it returns LINK1181 anyway.

    Has anyone ever had these kind of issues?

    R 1 Reply Last reply
    0
    • hskoglundH Offline
      hskoglundH Offline
      hskoglund
      wrote last edited by
      #2

      Hi, open62541 is written in C without any Qt in it, but this is a Qt C++ forum.

      1 Reply Last reply
      1
      • C casina

        I need to create a OPC-UA client connecting to a server using either a certificate or user/password authentication. While testing the connection with neither of these I got a BadAuthenticationToken error.
        In the case below encryption was disabled on endpoint 0, and the client was trying to connect without any kind of authentication.
        Screenshot_OPC-UA_BadAuthenticationToken.png
        Reading the library documentation it seems it may be an issue with the encryption...

        After that I tried adding encryption to the client, attempting to connect to the other endpoints, but my linker retun linker errors when linking the openssl libraries libssl.lib and the libcrypto.lib. I already tried manually adding these libraries to the linker but it returns LINK1181 anyway.

        Has anyone ever had these kind of issues?

        R Offline
        R Offline
        Redman
        wrote last edited by Redman
        #3

        @casina When your QOpcUaClient emits endpointsRequestFinished you can do following in the slot to change the endpoint.

        void
        UaClient::endpointsRequestFinished(
            QList<QOpcUaEndpointDescription> endpoints,
            QOpcUa::UaStatusCode statusCode,
            QUrl requestUrl) {
        for (QOpcUaEndpointDescription& epd : endpoints) {
        // Connect to unsecure node
              if (epd.securityMode() ==
                      QOpcUaEndpointDescription::MessageSecurityMode::None &&
                  epd.securityPolicy().contains("None")) {
                 m_client->connectToEndpoint(epd);
              }
         }
        

        Maybe your opcua server does not allow a connection to the unsecured endpoint as you try to do. With the above mentioned approach you can select a different endpoint.

        To me it looks like during building the opcua module cmake was not able to find openssl on your pc. This is required to be able to use secure endpoints. All secure endpoints from your server are annotated with "not supported".
        https://doc.qt.io/qt-6/qtopcua-build-openssl.html

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved