Skip to content
MtrXTools

no peer certificate available

The handshake failed before a certificate arrived

Seen in openssl s_client

openssl s_client got no certificate from the server, which means the TLS handshake failed or never really started.

Common causes

  • The server needs SNI and -servername was not given, so it aborted the handshake.
  • The port does not speak TLS directly, for example a STARTTLS port such as 25 or 587 without -starttls smtp.
  • No TLS version or cipher in common, so the server sent an alert or closed the connection.
  • A firewall or proxy reset the connection.

How to fix it

  1. Add -servername host to the command.
  2. For mail ports use -starttls smtp (or imap, pop3), or connect to the implicit TLS port.
  3. Read the error lines printed above "no peer certificate available"; they name the alert or failure.
  4. Try -tls1_2 and -tls1_3 to see which version the server accepts.
Check the certificate from outside

Got a different message? Paste it into the error explainer.

Related errors

All 34 Command line & code errors