Skip to content

Connection doctor

When a probe cannot connect, the protocol error you get often names a symptom from a different layer than the cause. A TLS mismatch on a database port, for example, can read like a broken server. The connection doctor checks the connection one step at a time (from resolving the name to logging in) and stops at the first step that fails.

The doctor is available on every tier, including Free. It applies to a probe of any protocol. Select the probe and click the Analyze: Connection doctor button in the probe toolbar. The analysis is created next to the probe, runs once and opens. See the overview for how analyses are kept and refreshed.

Connection doctor: DNS and TCP passed, the TLS handshake failed and the steps above it were not reached

StepWhat it checks
DNS resolveThe probe’s host resolves to an address through this machine’s resolver. An IP address needs no lookup and passes.
TCP connectA TCP connection to the port opens within five seconds. The connection is closed straight away.
TLS handshakeA TLS handshake completes on the port. This step runs only when the probe asks for TLS from the first byte. A probe that upgrades in-band (STARTTLS on SMTP or IMAP, explicit TLS on FTP) gets the upgrade checked in the next steps instead. MySQL, PostgreSQL and SQL Server negotiate TLS inside their own handshake, so for them this step is Not applicable with a note saying so. The login step then connects with the probe’s TLS mode. The certificate is not judged here. TLS posture checks it.
Protocol greetingSomething on the port speaks the probe’s protocol (a mail server sends its banner, for example).
AuthenticationThe probe’s credential logs in.

Each step ends as OK, Failed, Not applicable (the step does not apply and the doctor goes on) or Not reached (an earlier step failed). The first failed step is marked Diagnosis and every step above it is Not reached, so the result names one cause. A failed connection shows its outcome in words under the step, such as Connection refused, Connection timed out or Name did not resolve. Click a step to see its detail (the address a name resolved to, the TLS note) and, on the failed step, the finding that explains it.

The greeting and authentication steps need the protocol’s own client, so they exist for these protocols:

ProtocolGreetingLogin
MySQL, PostgreSQL, SQL ServerThe server accepts the connectionSELECT 1 as the probe’s user
MongoDBpingping as the probe’s user
LDAPNo separate exchange: any answer to the bind passesA bind with the probe’s credential
RedisNo separate exchange: any reply to AUTH or PING passesAUTH when the probe has a password, otherwise PING
SMBNEGOTIATESession setup with the probe’s credential (the domain comes from DOMAIN\user or the probe’s domain field)
SMTPThe banner and EHLO, plus STARTTLS when the probe uses itAUTH PLAIN
IMAPThe greeting, plus STARTTLS when the probe uses itLOGIN
FTPThe 220 banner, plus AUTH TLS when the probe uses explicit TLSUSER and PASS

For every other protocol (HTTP, DNS, Kerberos, SpamAssassin, ActiveMQ and Freestyle) the doctor checks DNS, TCP and TLS and marks the last two steps Not applicable. The TCP step always opens a TCP connection, so a DNS, Kerberos or Freestyle probe that sends over UDP fails that step against a server that listens on UDP only.

The login is attempted with whatever credential the probe carries. A probe with no credential is checked as an anonymous client, which a server that requires a login will refuse at the authentication step.

A refused login leaves the greeting OK and fails only authentication. A port that accepted TCP but answered with something else (a different service, or a TLS-only port reached in the clear) fails the greeting and the login is never tried.

Every failure comes with a finding that names the cause, written for the step that failed:

StepFinding
DNS resolveHost does not resolve to an address
TCP connectNothing is listening (refused), No response (timed out, which points at a firewall or a wrong host rather than the port) or Connection was reset
TLS handshakeTLS handshake failed, with the reason the TLS library gave
Protocol greetingConnected but it did not speak the protocol
AuthenticationThe cause the server reported (see below), with the SQLSTATE, error code or NT status when the server sent one

These causes are named only when the server’s answer carries them:

CauseRead from
The server does not know this useran Active Directory bind (data code 525), an SMB NT status
The password is wrongan Active Directory bind (52e), an SMB NT status
This account is disabledan Active Directory bind (533), an SMB NT status, PostgreSQL, SQL Server
This account is locked outan Active Directory bind (775), an SMB NT status, MySQL
The password has expiredan Active Directory bind (532 or 773), an SMB NT status, MySQL, SQL Server
This account has expiredan Active Directory bind (701), an SMB NT status
This account may not log in from here or at this timean Active Directory bind (530 or 531), an SMB NT status
The database does not existMySQL, PostgreSQL
This account may not open the databaseMySQL, SQL Server
No server rule admits this connectionMySQL (host not allowed), PostgreSQL (pg_hba.conf)
The server requires a login and the probe sends noneMySQL (login sent without a password), Redis (NOAUTH)

Many servers give the same answer for a wrong user name and a wrong password (OpenLDAP, SMB’s generic logon failure, PostgreSQL, SQL Server, Redis and SMTP among them). The finding then says that the server does not tell which part failed, so both need checking.

Some rejected logins have a known configuration cause. For those the authentication finding says so and names the setting that fixes it:

  • MySQL: the account uses caching_sha2_password over a plaintext connection and the client needs public-key retrieval allowed, or TLS
  • PostgreSQL: the server accepts no unencrypted client from here, so the probe needs TLS set to required
  • PostgreSQL and SQL Server: the server’s certificate is not trusted, so the probe can encrypt without verifying it (TLS mode required) or the issuing CA has to be trusted
  • MongoDB: every failed login gets the same code, so the finding points at the authentication database as the usual cause
  • LDAP: the directory requires an encrypted connection before it accepts a bind, so TLS has to be turned on
  • Redis: the server has no password configured, so the credential on the probe has to be cleared

The advisor on the probe editor reads a failed send with the same rules and offers these fixes without running the doctor.

The ANALYZE step can run the doctor in a chain. The step itself passes whatever the doctor finds, so the chain stops at the doctor with the real cause only when an ASSERT after it checks the result (an ANALYSIS_STATUS of OK, for example). Put the pair before a step that talks to an unreliable target. The DOCTOR_RUNG extractor reads the status of one step into a variable for such an assertion: its expression is the step id (dns, tcp, tls, handshake for Protocol greeting or auth) and the value is OK, FAIL, NOT_APPLICABLE or SKIPPED. The advisor offers to insert the ANALYZE step for you when a send failed in the last run.