How-To

TLS Handshake Failed: NoCipherSuitesInCommon (How to Fix)

"TLS handshake failed: peer is incompatible: NoCipherSuitesInCommon" means the client and server share no TLS version or cipher suite they both accept. Test the endpoint with openssl, confirm the port matches the encryption mode (465 implicit TLS, 587 STARTTLS), then update whichever side offers only legacy ciphers.

Sohail HussainSohail Hussain9 min read

Short answer

  • The client and the server could not agree on a TLS version or cipher suite, so the connection died before any SMTP login. Your credentials are not the cause.
  • Run openssl s_client against the server on TLS 1.2 and 1.3, confirm the port matches the encryption mode, then upgrade or reconfigure whichever side only offers old TLS or weak ciphers.

You see this in a log while testing an MTA, or when a sending tool connects to your own SMTP listener:

TLS handshake failed: peer is incompatible: NoCipherSuitesInCommon

The wording is typical of rustls, the Rust TLS library. People on the KumoMTA community forum have reported it when pointing a GMass-style sender at a KumoMTA listener, and a related report on the n8n community forum describes Connection closed unexpectedly against Gmail SMTP even though the same credentials worked in GMass. The second one is usually a port and mode mismatch rather than a cipher problem; both are covered below.

What the error means

  • TLS handshake failed means the TCP connection opened and TLS negotiation ran, but it never got as far as SMTP AUTH or MAIL FROM.
  • peer is incompatible means the other side's offer cannot be matched to anything this side will accept.
  • NoCipherSuitesInCommon is the reason: the client's list of cipher suites and the server's allowed list do not overlap.

In TLS 1.3, the ClientHello carries a list of cipher suites in the client's order of preference, and the server must ignore ones it does not support and work with the rest, according to RFC 8446. If nothing remains after that filtering, there is nothing to negotiate. TLS 1.3 itself defines only a handful of suites, all AEAD (for example TLS_AES_128_GCM_SHA256 and TLS_AES_256_GCM_SHA384).

Rustls is deliberately strict, so a client that offers only TLS 1.0/1.1, RC4, 3DES or other legacy suites will fail every time. The IANA registry marks many of those older suites as not recommended, which is why modern libraries dropped them (IANA TLS parameters). Typical offenders are old desktop senders, embedded devices, outdated Java or .NET runtimes and old OpenSSL builds.

Which side logged the line matters. If it appears in the MTA log for an inbound session, the connecting client is too old or misconfigured. If the MTA logged it while delivering outbound, the remote server is the restrictive or legacy party.

Causes at a glance

CauseSymptomFix
Client only offers TLS 1.0/1.1 or legacy suitesFails on every attempt, before loginUpdate the client or runtime; enable TLS 1.2
Server restricted to a narrow suite listOne client fails, others workReview the server's TLS policy
Certificate key type mismatchFails only for certain clientsReissue with a key type clients support
Implicit TLS vs STARTTLS mix-upHandshake error or connection closedMatch port and encryption mode
Old OpenSSL security level on a remote hostOutbound delivery fails to one domainCheck that host's policy before changing yours

Step-by-step fixes

Fix 1: Check what the server offers

From a machine that can reach the server, test STARTTLS on port 587 and implicit TLS on port 465:

openssl s_client -connect mail.example.com:587 -starttls smtp -tls1_2
openssl s_client -connect mail.example.com:587 -starttls smtp -tls1_3
openssl s_client -connect mail.example.com:465 -tls1_2
  1. Run the commands above against your own listener, using the port you actually expose.
  2. Look for a Cipher is ... line in the output, such as TLS_AES_256_GCM_SHA384 or ECDHE-RSA-AES256-GCM-SHA384.
  3. If TLS 1.2 or 1.3 completes, the server is fine and the client is the problem. Go to Fix 3.
  4. If both fail, the server's TLS configuration is the problem. Go to Fix 4.
  5. To list every suite a server accepts, run nmap --script ssl-enum-ciphers -p 587 mail.example.com.

Fix 2: Match the port to the encryption mode

A wrong pairing produces handshake failures or a dropped connection.

PortModeClient setting
25Plain, upgrades with STARTTLSServer-to-server; many hosts block it for clients
587STARTTLS (submission)"STARTTLS" or "TLS", not "SSL"
465Implicit TLS (SMTPS)"SSL/TLS" on

The common mistake is turning on implicit SSL while pointing at 587, or choosing STARTTLS on 465. The server then receives plaintext where it expects a TLS ClientHello, or the reverse, and drops the connection.

Check that your listener serves the mode you chose. A listener offering STARTTLS on 587 will not answer an implicit-TLS client. Confirm the listener port and TLS settings in your MTA's configuration for your version.

Tip

If a tool offers only "use SSL" and "don't use SSL", SSL means implicit TLS, so pair it with port 465. Without SSL, the client begins in plain text and upgrades with STARTTLS, so pair it with 587.

Fix 3: Update an old client

When the client is the legacy side, in order of preference:

  1. Update the sender software or its runtime. A current build usually negotiates TLS 1.2 or higher by default.
  2. Enable TLS 1.2 explicitly if the client has a setting for it. Older Windows and .NET stacks often leave it off.
  3. On Linux, check the OpenSSL configuration. Microsoft's .NET documentation notes that on many distributions the file is at /etc/ssl/openssl.cnf and that the cipher policy can be set there or in code, so a locked-down policy can remove suites the client needs.
  4. Put a modern relay or proxy in front of the old sender, so the legacy device talks to something it can reach and that talks modern TLS onward.

I would not loosen the server to accept TLS 1.0 or weak suites to suit one client. You trade one old sender for a downgrade risk on every connection.

Fix 4: Check the server side

If the server is the restrictive one, look at these:

  • Certificate and key type. The server can only pick suites compatible with its certificate's key. An ECDSA-only certificate and a client that offers only RSA-based suites can end in this same error. Reissuing the certificate with a key type your clients support removes the mismatch.
  • TLS backend and cipher settings. KumoMTA's default TLS stack is rustls, and it can be set to use OpenSSL instead. If you need a suite rustls does not offer, that is the route to look at. I could not confirm the exact option names from an authority source, so read the KumoMTA documentation for your version, since they have changed between releases.
  • A restricted OpenSSL on the other end. Some distributions ship security levels that reject older suites by default. Check the remote server's own policy before changing yours.

The n8n and Gmail case

The Connection closed unexpectedly report is not a cipher error, but a port and mode mismatch is a common cause. Google's documentation lists two Gmail SMTP options: smtp.gmail.com on port 465 with implicit SSL/TLS, and on port 587 with TLS (STARTTLS). Google also notes that a client that begins in plain text and then issues STARTTLS should use port 587; see IMAP, POP, and SMTP for Gmail.

  1. Set the host to smtp.gmail.com.
  2. Use port 465 with the SSL/TLS option on, or port 587 with it off (STARTTLS).
  3. Use an app password if the account has two-step verification, or OAuth where the tool supports it. A normal account password is typically refused.
  4. Remember that the same credentials working in another tool proves they are right. It says nothing about which port and mode that tool chose for you.

Note

Google's help page on sending from an app lists SSL on port 465 and TLS on port 587 for smtp.gmail.com. Tools label these options differently, so check what each label means in your tool.

Checklist before you try again

  • The client and server agree on implicit TLS (465) or STARTTLS (587).
  • openssl s_client completes on TLS 1.2 or 1.3 against the exact host and port.
  • The client runtime supports TLS 1.2 or higher and has it enabled.
  • The certificate's key type suits the clients you expect.
  • You know which side logged the error, inbound or outbound.
  • You retested after any certificate renewal or MTA upgrade.

If nothing works

Contact the project's support channel (for KumoMTA, its documentation and community), your hosting provider, or the sender tool's vendor. Include:

  • the full error line with timestamp and client IP
  • the openssl s_client output for TLS 1.2 and 1.3
  • the client software name and version, plus its runtime (Java, .NET, OpenSSL version)
  • the server's certificate key type and the listener port and mode
Subject: TLS handshake failed: peer is incompatible: NoCipherSuitesInCommon

Hi, our SMTP client fails before login with:
"TLS handshake failed: peer is incompatible: NoCipherSuitesInCommon"

Server: mail.example.com, port 587 (STARTTLS)
Client: {client name and version}, runtime {Java/.NET/OpenSSL version}
First seen: {timestamp with timezone}
Tried: openssl s_client with -tls1_2 and -tls1_3 (output attached),
checked port and encryption mode, certificate key type {RSA/ECDSA}.

Which TLS versions and cipher suites does the listener allow, and what
should the client offer?

Reading a delivered message's headers can also show which TLS version earlier hops used; our email header analyzer breaks down the Received chain. For background, see SSL/TLS for email and the SMTP glossary entry.

Common questions

Is NoCipherSuitesInCommon a certificate problem?

Sometimes. The certificate's key type limits which suites the server can use, so an ECDSA-only certificate can leave no overlap with a client that offers only RSA suites. Most of the time, though, it is an old client or a narrow server policy.

Should I enable TLS 1.0 on the server so the old client works?

I would not. It weakens every connection to fix one sender. Update the client, or put a modern relay in front of it.

Why does the same login work in GMass but fail in another tool?

The credentials are fine. The tools probably chose different ports or encryption modes, or use different TLS libraries. Compare the host, port and SSL/STARTTLS setting between the two.

Does the error mean my password is wrong?

No. The handshake fails before authentication, so the server never sees the password.

strategygmasserror-codes
Share this article
Sohail Hussain

Sohail Hussain

Founder & CEO at Mailneo

Building Mailneo — AI-powered email marketing for growing businesses.

Ready to supercharge your email marketing?

Start sending smarter emails with AI-powered campaigns. No credit card required.

Get Started Free