Fix SSL Wrong Version Number (SSL routines::wrong version number)

What error:0A00010B SSL routines::wrong version number means in curl and OpenSSL: TLS sent to a plain HTTP port, implicit TLS on a STARTTLS port like 587, or an https:// proxy that only speaks HTTP, and how to test each.

Home › Guides › SSL wrong version number

Last updated 18 November 2026

Quick answer

Despite the name, this error is almost never about TLS 1.2 versus 1.3. It means your client started a TLS handshake and the first bytes that came back were not a TLS record. Something on that port answered in plain text: an HTTP server, an SMTP, IMAP or POP3 greeting, or a proxy that doesn't speak TLS. Check, in this order:

  1. Right scheme for the port? https:// pointed at a plain HTTP port (80, 8080, an app's HTTP listener) gives this error.
  2. Implicit TLS or STARTTLS? Mail ports 587, 25, 143 and 110 start in plain text and upgrade with STARTTLS. Using smtps://, "SSL/TLS" or a plain openssl s_client on them gives this error. Ports 465, 993 and 995 are the implicit-TLS ports.
  3. Proxy scheme? HTTPS_PROXY=https://proxy:3128 makes curl speak TLS to the proxy. Most proxies listen in plain HTTP: use http://proxy:3128.
  4. Server listener? A web server, load balancer or reverse proxy that serves plain HTTP on the port clients use for HTTPS.

What the error looks like

WhereText
curl (8.14.1 with OpenSSL 3.5.7)curl: (35) TLS connect error: error:0A00010B:SSL routines::wrong version number
OpenSSL 3.x applicationserror:0A00010B:SSL routines::wrong version number
openssl s_client (OpenSSL 3.5.7)...:error:0A00010B:SSL routines:tls_validate_record_header:wrong version number:...
OpenSSL 1.1.1 applicationserror:1408F10B:SSL routines:ssl3_get_record:wrong version number

The format comes from OpenSSL's ERR_error_string: error:[error code]:[library name]::[reason string] in OpenSSL 3.0, and error:[error code]:[library name]:[function name]:[reason string] in 1.1.1. The reason is SSL_R_WRONG_VERSION_NUMBER (267, hex 10B) in the SSL library (20), which is why the code ends in 10B in both versions. curl exit code 35 is CURLE_SSL_CONNECT_ERROR: "A problem occurred somewhere in the SSL/TLS handshake."

On the server side, OpenSSL reports the mirror image. When a client sends a plain HTTP request (GET, POST, HEAD or PUT) to a TLS port, the server logs http request (error:0A00009C:SSL routines::http request); a plain proxy CONNECT gives https proxy request.

Why the name is misleading

Every TLS record starts with a 5-byte header: content type (1 byte), version (2 bytes) and length (2 bytes), as laid out in RFC 8446 section 5.1. For every TLS version the first version byte is 3: TLS 1.2 records carry {3,3}, TLS 1.3 sets legacy_record_version to 0x0303 (an initial ClientHello may use 0x0301), and RFC 8996 notes that servers must accept any {03,XX} record version in a ClientHello. OpenSSL's record layer checks that byte on the first record it receives. If it isn't 3, and the bytes don't look like an HTTP request or a proxy CONNECT, it stops with wrong version number and doesn't send an alert.

So when a plain HTTP server answers HTTP/1.1 400 Bad Request, OpenSSL reads the characters TT as the version. An SMTP server's 220 mail.example.com ESMTP greeting gives 20. Neither is a TLS version, hence the error. OpenSSL also uses the same reason later in a connection when a record's version doesn't match the negotiated one, but that is rare. A real version disagreement between two TLS speakers shows up as tlsv1 alert protocol version or unsupported protocol instead; see SSL handshake failure and protocol version errors.

Step 1: Find out what the port really speaks

Ask the port in plain text. If either of these gets a readable answer, the port isn't TLS:

curl -sv http://www.example.com:443/ -o /dev/null
openssl s_client -connect www.example.com:8443 -servername www.example.com -brief

An HTTP status line from the first command, or wrong version number from the second, means that listener is plain HTTP. If a server or load balancer should be serving TLS there, fix it (Step 4). If the port is meant to be plain HTTP, change the client URL to http:// or to the real HTTPS port.

-k / --insecure does not help: the handshake fails before any certificate is received, so there is nothing to skip.

Step 2: Mail servers, implicit TLS vs STARTTLS

RFC 8314 calls TLS that starts immediately on connect "Implicit TLS" and contrasts it with STARTTLS, which upgrades an established cleartext connection. The two are not interchangeable on the same port.

ServiceImplicit TLS port (TLS from the first byte)STARTTLS port (plain text greeting, then upgrade)
SMTP submission465 (submissions)587
IMAP993 (imaps)143
POP3995 (pop3s)110
SMTP between serversnone25

With STARTTLS (RFC 3207 for SMTP) the server first sends a normal greeting and only switches to TLS after the client sends STARTTLS and the server replies 220 Ready to start TLS. A client that starts TLS straight away on 587 reads that greeting as a TLS record and fails with wrong version number. Test each style like this:

# STARTTLS ports (587, 25, 143, 110)
openssl s_client -connect smtp.example.com:587 -starttls smtp -brief
curl -v --ssl-reqd smtp://smtp.example.com:587

# Implicit TLS ports (465, 993, 995)
openssl s_client -connect smtp.example.com:465 -brief
curl -v smtps://smtp.example.com:465

openssl s_client -starttls supports smtp, pop3, imap, ftp, xmpp, ldap, postgres, mysql and others. In curl, --ssl-reqd requires the STARTTLS upgrade and fails if it can't happen; --ssl also tries it but falls back to an unencrypted connection, which curl itself warns is insecure. URL schemes such as smtps://, imaps:// and pop3s:// mean implicit TLS.

Microsoft 365: for client SMTP submission Microsoft says to use smtp.office365.com on port 587 (recommended) or 25 with TLS/StartTLS, and that a device that recommends or defaults to port 465 doesn't support the required TLS versions. If a scanner or app set to "SSL/TLS" fails against port 587, switch it to STARTTLS. If it then fails to sign in, see 535 5.7.139 Authentication unsuccessful and 5.7.57 client not authenticated.

Step 3: Check proxy settings

curl's manual says a proxy string with no scheme or http:// is an HTTP proxy, and https:// means an HTTPS proxy, where curl does TLS with the proxy itself. A traditional forward proxy listening in plain HTTP answers that TLS handshake in plain text, and you get (35) ... wrong version number before the real site is ever contacted. HTTPS sites still get end-to-end TLS through a plain HTTP proxy: the client asks the proxy for a tunnel with CONNECT, which RFC 9110 describes as blind forwarding that can then be secured using TLS.

env | grep -i _proxy
# Wrong for a plain HTTP proxy:
export HTTPS_PROXY=https://proxy.example.com:3128
# Right:
export HTTPS_PROXY=http://proxy.example.com:3128
curl -v -x http://proxy.example.com:3128 https://www.example.com/

curl reads these variables in lower or upper case, and the lower case one wins if both are set (http_proxy is only read in lower case). ALL_PROXY applies when no protocol-specific proxy is set, and NO_PROXY lists hosts that skip the proxy. Other tools have their own proxy settings; check their documentation.

Step 4: Server-side causes

After the listener speaks TLS, check the certificate it serves with the SSL Certificate Checker and openssl s_client -connect www.example.com:443 -servername www.example.com -showcerts.

Checking many ports at once?

The Bulk SSL Certificate Expiry Monitor on Apify connects to each host and port, uses STARTTLS automatically on 25, 587, 143, 110 and 21 (or the mode you force), and reports the TLS version, cipher and certificate for each endpoint. A port that doesn't speak TLS comes back as ERROR with the reason, so a list of servers shows which ones are misconfigured ($1 per 1,000 endpoints).

Related tools and guides

Check the certificate a server issues and its expiry with the SSL Certificate Checker, find mail hosts with the MX Record Lookup and their MTA-STS policy with the MTA-STS Checker, look up A and AAAA records with DNS Lookup, see who operates the IP that answered (a CDN, cloud load balancer or proxy) with the ASN IP Lookup and Cloud IP Lookup, and confirm DNS changes with the DNS Propagation Checker. Related guides: SSL handshake failure and protocol version, unable to get local issuer certificate, SSL certificate name mismatch, SSL unexpected eof while reading and Exchange Online 535 5.7.139.

FAQ

What does SSL routines::wrong version number mean?

The client started a TLS handshake and the reply did not start with a TLS record header, so OpenSSL could not read a TLS version from it. In practice the port answered in plain text: plain HTTP, an SMTP, IMAP or POP3 greeting before STARTTLS, or a proxy that does not speak TLS.

Why does curl return error 35 wrong version number?

Exit code 35 is CURLE_SSL_CONNECT_ERROR, a failed TLS handshake. With wrong version number the usual causes are an https:// URL on a plain HTTP port, smtps:// or imaps:// on a STARTTLS port such as 587 or 143, or an HTTPS_PROXY value that starts with https:// for a proxy that only speaks HTTP.

Should I use port 465 or 587 for SMTP?

Port 465 is implicit TLS, so TLS starts on connect. Port 587 starts in plain text and upgrades with STARTTLS. Match the client setting to the port. For Microsoft 365 client submission, Microsoft says to use smtp.office365.com on port 587 (or 25) with STARTTLS.

Will curl -k or --insecure fix wrong version number?

No. The handshake fails before the server sends a certificate, so there is nothing for --insecure to skip. Fix the scheme, port, STARTTLS setting or proxy instead.

Is wrong version number caused by TLS 1.0 or 1.1 being disabled?

Usually not. When two TLS endpoints disagree on the version, OpenSSL reports tlsv1 alert protocol version or unsupported protocol. Wrong version number on the first record means the other side was not speaking TLS at all.

Want the full kit?

Runbooks, checklists and helpdesk templates: IT Admin Packs on Gumroad.