Skip to content
ecdsa.com
curl (OpenSSL backend)curl

Error message

curl: (35) TLS connect error: error:0A00042E:SSL routines::tlsv1 alert protocol version

Also printed as

  • curl: (35) error:0A00042E:SSL routines::tlsv1 alert protocol version
  • curl: (35) error:1409442E:SSL routines:ssl3_read_bytes:tlsv1 alert protocol version

Recent curl releases put "TLS connect error: " before the OpenSSL reason. OpenSSL 1.1.1 includes the function: "error:1409442E:SSL routines:ssl3_read_bytes:tlsv1 alert protocol version". If the server instead picks a version the client refuses, the client reports "unsupported protocol".

curl (OpenSSL backend) — CURLE_SSL_CONNECT_ERROR, TLS alert 70 (protocol_version) received from the server

What it means

The server sent TLS alert 70 (protocol_version): none of the TLS versions curl offered is acceptable to it. The prefix "tlsv1" is only the name OpenSSL gives to alerts defined since TLS 1.0, not the version in use. Usually the server is stuck on TLS 1.0/1.1 while the client offers 1.2 and 1.3, or a client was capped below the server's minimum.

Why it happens

How to fix it

  1. 1.

    Find the versions the server accepts

    Try each version with openssl s_client. The result tells you whether to fix the server (only tls1/tls1_1 accepted) or the client (it never offered the accepted version).

    bash
    for v in tls1 tls1_1 tls1_2 tls1_3; do
      printf '%s: ' "$v"
      openssl s_client -connect api.example.com:443 -servername api.example.com -"$v" </dev/null >/dev/null 2>&1 \
        && echo accepted || echo refused
    done
  2. 2.

    Enable TLS 1.2 and 1.3 on the server

    Upgrade the TLS configuration (and, if necessary, the TLS library or the operating system) so the server accepts TLS 1.2 and 1.3.

    text
    # nginx
    ssl_protocols TLSv1.2 TLSv1.3;
    # HAProxy (global section)
    ssl-default-bind-options ssl-min-ver TLSv1.2
  3. 3.

    Remove version caps on the client

    Delete --tls-max and old protocol flags from scripts and .curlrc; set only a minimum, so curl can negotiate the highest version both sides support.

    bash
    grep -nE 'tls-max|tlsv1|sslv3' ~/.curlrc   # a forgotten cap in the config file
    curl --tlsv1.2 https://api.example.com/        # minimum 1.2, no maximum

Related errors

Browse the full signature error database