IMD SolutionComputing LibraryShop main store

Troubleshooting

Transmission fails TLS while other MQTT clients connect

Edge computing and IIoT Published 9 min read

Short answer

MQTT Explorer and openssl s_client prove only the path from the machine you ran them on. Transmission runs on the Ignition server, so test the TLS route from that host to the broker hostname on port 8883; in the reported case a firewall policy specific to the server was blocking it, and allowing that traffic restored the connection. A PKIX path building failed exception is a trust-store fault, not a firewall fault.

On this page
  1. Why does MQTT Transmission fail TLS when MQTT Explorer connects?
  2. What does Failed to achieve connected state tell you?
  3. Which host do you have to test the TLS path from?
  4. How do you run the TLS test on the Ignition server?
  5. Is PKIX path building failed a firewall fault?
  6. Do the certificate alias and hostname checks still matter?
  7. How do you verify the fix on both ends?
  8. Questions asked

MQTT Explorer connects over TLS, openssl s_client connects, and Ignition's MQTT Transmission module alone reports Failed to achieve connected state. Those two passes prove only the network path of the machine they ran on, and that machine is not the one Transmission runs on. Test the TLS route from the Ignition server itself, to the same broker hostname on port 8883: in the reported case the network team found a firewall policy written against that server, allowed the flow, and Transmission went from 0 of 1 to 1 of 1 connected. Keep the certificate diagnosis separate: PKIX path building failed is a trust-chain verdict, not a network verdict.

Why does MQTT Transmission fail TLS when MQTT Explorer connects? #

MQTT Explorer and openssl s_client test the TLS path from the workstation you ran them on, not from the Ignition server; Transmission runs on the server, so the two passing tests prove nothing about the firewall policy that server actually crosses.

Every connection test carries three variables at once: the source host it ran on, the destination hostname it dialed, and the destination port. A pass is evidence for exactly that triple and nothing else. Explorer and s_client both ran from the engineer's workstation, so the two green results describe one path, tested twice. Transmission lives where Ignition lives; it is the only one of the three clients whose traffic leaves from the server, and it is the only one that failed.

Test Source host Destination What the result proves
MQTT Explorer with TLS enabled the workstation broker hostname on 8883 that workstation's route carries a TLS handshake
openssl s_client with the same CA file the workstation broker hostname on 8883 the same route a second time, so nothing new
Transmission over an ssl:// URL the Ignition server broker hostname on 8883 the only test of the route the failing client uses

Two passing rows share a source host, so together they cannot clear a third row that leaves from a different address. The other candidate is the client module itself, and the same split — one client connecting while another will not — appears in the case where MQTT Transmission fails while MQTT Engine connects to AWS IoT Core, where the cause sat in configuration. Order the work network first, module second: the network test costs minutes and decided this incident.

What does Failed to achieve connected state tell you? #

Failed to achieve connected state is Transmission's summary line and it covers network refusal, certificate-path rejection, hostname mismatch and session faults alike, so the line alone decides nothing; the HiveMQ log from the same second tells you which stage died.

The Transmission side logs one line per attempt, tagged with the group, edge node and client ID, and stops there. The broker side carries the useful half of the evidence: HiveMQ recorded the connection arriving at its TLS listener and then vanishing with the client still unidentified — it logged the client ID as UNKNOWN and the line disconnected ungracefully from TCP Listener with TLS on port: 8883.

A firewall rule that silently denies a flow usually leaves no listener entry at all, because nothing arrives. A connection that reaches the listener and dies inside the handshake fits a policy that lets the flow begin and breaks it part way — which is where the resolved cause sat: a policy specific to the Ignition server's path, not the workstation's. Read the two logs together at matched timestamps before touching any certificate setting.

Which host do you have to test the TLS path from? #

Test from the Ignition server itself, to the same broker hostname on port 8883 that Transmission uses; a workstation test crosses a different firewall policy, and in the reported case only the policy on the server's path was blocking the connection.

Worked example, with illustrative addresses. The broker hostname is broker.example.com and resolves to 203.0.113.10; the workstation sits at 192.168.1.50; the Ignition server sits at 192.168.1.20. The counting rule: a test result transfers to Transmission only when source address, destination hostname and destination port all match its connection. Score the two workstation passes against that rule — source matches 0 of 2, destination and port match 2 of 2, so the best any of them scores is 2 of 3 variables, one short every time. The decisive test is the one nobody had run: from 192.168.1.20 to broker.example.com on the same TLS port. The incident ended the way that logic predicts: once the network team allowed the server-to-broker flow, Transmission returned to 1 of 1 connected.

Run the checks in this order and stop at the first one that fails:

  1. From the Ignition server, resolve the broker hostname and write down the address it returns.
  2. From the Ignition server, test TCP reachability of the TLS port to that address.
  3. From the Ignition server, run the TLS handshake with the same CA file the Transmission configuration loads.
  4. Compare source address, destination hostname and destination port against the Transmission server connection, field by field.
  5. Hand the network team that exact tuple and ask for the policy on that flow, not on the workstation's.

How do you run the TLS test on the Ignition server? #

Run openssl s_client on the Ignition server, pointed at the broker hostname on port 8883, and have the network team trace that one source address to that one destination port; source, destination and port must all match what Transmission uses.

On a Linux host, or any host with an OpenSSL build, run the handshake from the server's own shell:

openssl s_client -connect broker.example.com:8883 -servername broker.example.com -CAfile ca.pem

The -CAfile argument must point at a copy of the same chain the Transmission configuration loads — here named ca.pem — so the test and the client judge the same trust material. A tail of Verify return code: 0 (ok) means the handshake and chain verification both succeeded from that host. A connection that opens and then resets before the certificate arrives, or times out outright, puts the fault on the path. On a Windows Ignition host, PowerShell answers the TCP half first:

Test-NetConnection -ComputerName broker.example.com -Port 8883

A TcpTestSucceeded value of True proves the port is open end to end from that server and says nothing about TLS, so pair it with the handshake test. For the stage-by-stage reading of a connection where TCP succeeds and TLS does not, the MQTT handshake diagnosis walkthrough maps each step and what breaks it.

Then take the tuple to the network team: the Ignition server's source address, the broker hostname with the address it resolves to on that host, and the destination port as configured. In the reported incident, that request surfaced the block, allowing the flow restored the connection, and no certificate setting had to change.

Is PKIX path building failed a firewall fault? #

No — PKIX path building failed is a certificate-trust verdict: the Java runtime on the server could not build a valid certification path to the requested target, so the fix is the CA Certificate File and the trust chain, not a firewall rule.

The full exception names the machinery: sun.security.validator.ValidatorException: PKIX path building failed, resolving to unable to find valid certification path to requested target. In plain words, the client's trust material contains no chain from the certificate the broker presented to a trust anchor it holds, so validation dies before any data moves. The fix lives in the CA Certificate File setting of the Transmission server connection, documented as the server's CA certificate file required for a secure connection: load the CA chain that signs the broker's certificate, and confirm the file on disk is the one the configuration points at.

One boundary keeps the two faults apart: the path-building exception belongs to a different reported failure than the incident resolved here, and it was never established as that incident's cause. The decision rule is mechanical. An exception in the log means certificate work. A connection that dies with no exception means network work, and the tests above decide it. A CA file that goes missing or empty after a restart fails the same way on an otherwise healthy path, as in the case of an MQTT connect failing after a power loss because the CA certificate is missing.

Do the certificate alias and hostname checks still matter? #

The certificate checks still matter: the alias or hostname carried in the broker certificate must match the hostname in the ssl:// URL, and when it deliberately does not, the verify hostname option is what tells Transmission to skip that comparison.

They were cleared early in the reported incident, which is part of why the diagnosis moved to the network: the name in the broker certificate matched the hostname in the URL, and unchecking verify hostname changed nothing. The URL carries the scheme ssl:// with the hostname and the TLS port, for example ssl://broker.example.com:8883, and the certificate's name has to match that hostname for verification to pass. Hostname matching is not Transmission-specific; it is the identity check TLS clients perform everywhere, and the TLS hostname authentication walkthrough for an S7-1500 shows the same comparison from a controller's side.

Leave verify hostname enabled in running service: with it unchecked, the handshake accepts any certificate the trust store validates, from any host that presents one, so a substitute endpoint could impersonate the broker; use the unchecked state only to prove a point during diagnosis and re-enable it once the names match.

How do you verify the fix on both ends? #

Success looks like 1 of 1 connected on the Transmission status line and no more unknown-client disconnected entries in the HiveMQ log; in the reported case the firewall rule change alone moved the counter from 0 of 1 back to 1 of 1.

On the Ignition side, the status line for that server connection returns to 1 of 1 connected, where the blocked state read 0 of 1. On the broker side, the repeating ungraceful-disconnect entries sourced from the server's address stop, and the broker lists the client as connected through its TLS listener. Then prove data rather than state: publish a tag through Transmission to a topic a subscriber watches and confirm the value arrives with a fresh timestamp.

The decisions, per case. Explorer and s_client pass while Transmission fails: test from the Ignition server before touching certificates, because the passes described a different path. The handshake from the server stalls or resets: network work — take the source, hostname and port tuple to the network team and get that flow allowed. The handshake from the server succeeds but Transmission still fails: collect the full Ignition module logs and read the exact exception, because the fault is now client-side in scope. A path-building exception anywhere in the log: trust-chain work — the CA Certificate File and its contents, never a firewall rule.

Questions asked

Why does the HiveMQ log call the client UNKNOWN and say it disconnected ungracefully?

UNKNOWN means the connection ended before the client sent the MQTT CONNECT packet that names it, so the broker never learned which client it was. Ungracefully means the TCP connection vanished without the MQTT DISCONNECT packet a client sends when it shuts down cleanly. Together the two words place the failure inside the TLS handshake window, which is why the log points at the path or the handshake rather than at an identified client session.

Which certificate belongs in the CA Certificate File setting?

The CA certificate that signed the broker's server certificate, including any intermediate chain the server presents, not a client identity certificate. Transmission uses that file the way a browser trusts a site's certificate authority: to verify the party on the other end of the TLS connection. A file holding only the broker's leaf certificate produces exactly that path-building failure, because Java cannot climb from the leaf to a trust anchor it holds.

Is it safe to leave verify hostname unchecked once the connection works?

No. Use it as a temporary diagnostic while you confirm every other setting, then re-enable it once the name in the broker certificate matches the hostname in the URL. With the check off, the handshake accepts any certificate your trust store validates, from any host that presents one, so a wrong endpoint could impersonate the broker and the client would still connect.

How do you confirm which broker address the Ignition server actually uses?

Resolve the broker hostname from the Ignition server itself, not from your workstation, because split DNS or a VPN route can return a different address per network. The firewall rule has to match the address and port that the server's own resolution produces; a policy written for the address your workstation resolves is a policy for a flow the server never takes.

Keep reading

  • Troubleshooting

    MQTT connect fails when TCP works: diagnose the handshake

    A successful raw TCP open to the broker port proves only routing and an open port; MQTT error 28 at Connect means the gateway ended the call with no usable session. Read the broker log during the attempt: no logged attempt means the gateway sent no MQTT data, a logged refusal means authentication or broker configuration, and an accept followed by an immediate close means a duplicate client identifier.

    Edge computing and IIoT

  • Troubleshooting

    MQTT TLS connects but no CONNACK: find the failing hop

    The connect callback fires only when the broker returns a CONNACK, so with TCP ESTABLISHED and no callback the failure is in the TLS handshake or between TLS and MQTT. Run openssl s_client against the listener, then mosquitto_sub -d with the same CA file and credentials; wrong credentials are not the cause, because the broker answers those with a CONNACK that fires the callback with a return code.

    Edge computing and IIoT

  • Troubleshooting

    Trace an edge gateway MQTT connection failure to Azure Event Grid

    A desktop MQTT client that connects and publishes with thumbprint authentication clears only that endpoint, certificate and permission combination on that host. When the gateway fails against the same Event Grid namespace, test four stages in order on the gateway itself: network path and DNS to TCP 8883, the TLS handshake with both certificate directions and the clock, the CONNECT identity, and publish authorization on the exact topic. The first stage that fails names the fix.

    Edge computing and IIoT