OPC-UA connection refused
-
I'm new to OPC-UA and I'm trying to connect to some machines using the
opcuaviewer
example.
I can connect to some of them, on others I get the following output:"Creating PKI path '/home/user/bin/pki/trusted/certs': SUCCESS." "Creating PKI path '/home/user/bin/pki/trusted/crl': SUCCESS." "Creating PKI path '/home/user/bin/pki/issuers/certs': SUCCESS." "Creating PKI path '/home/user/bin/pki/issuers/crl': SUCCESS." Discovering servers on "opc.tcp://192.168.1.50:4840" qt.opcua.plugins.open62541.sdk.userland: "AcceptAll Certificate Verification. Any remote certificate will be accepted." qt.opcua.plugins.open62541.sdk.securechannel: "Connection 11 | SecureChannel 3778283009 | Opened SecureChannel with SecurityPolicy http://opcfoundation.org/UA/SecurityPolicy#None" qt.opcua.plugins.open62541.sdk.client: "Client Status: ChannelState: Open, SessionState: Closed, ConnectStatus: Good" qt.opcua.plugins.open62541.sdk.client: "Client Status: ChannelState: Closed, SessionState: Closed, ConnectStatus: Good" qt.opcua.plugins.open62541.sdk.userland: "AcceptAll Certificate Verification. Any remote certificate will be accepted." qt.opcua.plugins.open62541.sdk.securechannel: "Connection 11 | SecureChannel 3778283010 | Opened SecureChannel with SecurityPolicy http://opcfoundation.org/UA/SecurityPolicy#None" qt.opcua.plugins.open62541.sdk.client: "Client Status: ChannelState: Open, SessionState: Closed, ConnectStatus: Good" qt.opcua.plugins.open62541.sdk.client: "Client Status: ChannelState: Closed, SessionState: Closed, ConnectStatus: Good" qt.opcua.plugins.open62541: Directory is empty Client state changed QOpcUaClient::Connecting qt.opcua.plugins.open62541: Directory is empty qt.opcua.plugins.open62541.sdk.userland: "AcceptAll Certificate Verification. Any remote certificate will be accepted." qt.opcua.plugins.open62541.sdk.securitypolicy: "The Basic128Rsa15 security policy with openssl is added." qt.opcua.plugins.open62541.sdk.securitypolicy: "The basic256 security policy with openssl is added." qt.opcua.plugins.open62541.sdk.securitypolicy: "The basic256sha256 security policy with openssl is added." qt.opcua.plugins.open62541.sdk.client: "The configured ApplicationURI does not match the URI specified in the certificate for the SecurityPolicy http://opcfoundation.org/UA/SecurityPolicy#None" qt.opcua.plugins.open62541.sdk.securechannel: "Connection 11 | SecureChannel 3778283011 | Opened SecureChannel with SecurityPolicy http://opcfoundation.org/UA/SecurityPolicy#None" qt.opcua.plugins.open62541.sdk.client: "Client Status: ChannelState: Open, SessionState: Closed, ConnectStatus: Good" qt.opcua.plugins.open62541.sdk.client: "Rejecting UserTokenPolicy 0 (username) in endpoint 0: configuration doesn't match" qt.opcua.plugins.open62541.sdk.client: "Rejecting endpoint 1: security mode doesn't match" qt.opcua.plugins.open62541.sdk.client: "Rejecting endpoint 2: security policy doesn't match" qt.opcua.plugins.open62541.sdk.client: "Rejecting endpoint 3: security mode doesn't match" qt.opcua.plugins.open62541.sdk.client: "Rejecting endpoint 4: security policy doesn't match" qt.opcua.plugins.open62541.sdk.client: "Rejecting endpoint 5: security mode doesn't match" qt.opcua.plugins.open62541.sdk.client: "No suitable UserTokenPolicy found for the possible endpoints" qt.opcua.plugins.open62541.sdk.client: "Client Status: ChannelState: Closed, SessionState: Closed, ConnectStatus: BadInternalError" qt.opcua.plugins.open62541: Open62541: Failed to connect Client error changed QOpcUaClient::UnknownError Client state changed QOpcUaClient::Disconnected
The manufacturer of the machines did not tell me anything but it listen on port 4840.
I'm not able to fully understand the root cause of these errors.Would you please help me to understand what's wrong here? So I can fix or ask more details to the manufacturer.
-
I got same problem, Do you have resolve it? Would someone please help me to resolve this?
-
qt.opcua.plugins.open62541.sdk.client: "Rejecting UserTokenPolicy 0 (username) in endpoint 0: configuration doesn't match"
Looks like it will not accept username/password auth? Is that a thing?
What does the QOpcUaClient::connectError() signal tell you? QOpcUaClient::error()?
-
void UaClient::recEndpointsRequestFinished( QList<QOpcUaEndpointDescription> endpoints, QOpcUa::UaStatusCode statusCode, QUrl requestUrl) { switch (m_connectionSettings) { case EndpointConnectionSettings::Default: { if (endpoints.size()) m_client->connectToEndpoint( endpoints .first()); // Connect to the first endpoint in the list break; } case EndpointConnectionSettings::Unsecure: { for (QOpcUaEndpointDescription& epd : endpoints) { // Connect to the unsecured endpoint if (epd.securityMode() == QOpcUaEndpointDescription::MessageSecurityMode::None && epd.securityPolicy().contains("None")) { m_client->connectToEndpoint(epd); break; } } break; } default: qWarning() << QStringLiteral("Unknown EndpointConnectionSetting"); } }
I communicate with 2 different OpcUa servers.
They allow different auth methods.
Maybe you can built up on my example