wrong version number SSL / TLS Origin: Network OSI layer 6 · Presentation Last updated 18 Nov 2026

Node.js: write EPROTO ... SSL routines:ssl3_get_record:wrong version number (https:// to an HTTP port, or http agent for https)

The client attempted TLS against a server (or port) that doesn't speak TLS, or used the wrong HTTP agent.

Exact message you may see write EPROTO error:1408F10B:SSL routines:ssl3_get_record:wrong version numberEPROTO SSL routines wrong version number NodeError: write EPROTO 139:error:1408F10BProtocol "https:" not supported. Expected "http:"
Seen on: Node.js SSL

Meaning

Check the URL scheme/port, use https.request/https.Agent for https URLs, and verify any proxy settings (an HTTP proxy URL with an https agent is a classic mistake). Test with curl -v.

Common causes

  • https:// to a plain HTTP port
  • http.Agent used for an https URL
  • Proxy URL scheme mismatch
  • Server redirecting to plain HTTP
  • Local dev server without TLS

⚡ Quick fix

  1. Match scheme and port
  2. Use the correct agent (https-proxy-agent for proxies)
  3. Verify with curl -v and openssl s_client

Detailed fix by platform

Node.js

  1. javascript
    const agent = new HttpsProxyAgent(process.env.HTTPS_PROXY);
    await fetch(url, { agent });

How to diagnose

  1. Scheme — Matches port?
  2. Agent — https?
  3. Proxy — Configured right?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Network. Errors that are often confused with or caused by this one (click to open):

ACM region — CloudFront can't use my ACM certificate: it must be requested in us-east-1 (N. Virginia) (SSL / TLS)ACM regionDjango — Django send_mail: ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] (EMAIL_USE_SSL vs EMAIL_USE_TLS on the wrong port) (Email / SMTP)DjangoNODE_EXTRA_CA_CERTS — Node.js: UNABLE_TO_VERIFY_LEAF_SIGNATURE / SELF_SIGNED_CERT_IN_CHAIN behind a corporate proxy (NODE_EXTRA_CA_CERTS) (SSL / TLS)NODE_EXTRA_CA_CERTSplaintext — Java: SSLException — Unrecognized SSL message, plaintext connection? (HTTPS client talking to an HTTP port) (SSL / TLS)plaintextSSL routines: wrong version number — OpenSSL: error:1408F10B:SSL routines:ssl3_get_record:wrong version number (SSL / TLS)SSL routines: wrong v…SSL_ERROR_RX_RECORD_TOO_LONG — Firefox: Secure Connection Failed — SSL received a record that exceeded the maximum permissible length. Error code: SSL_ERROR_RX_RECORD_TOO_LONG (SSL / TLS)SSL_ERROR_RX_RECORD_T…Timeout during connect (likely firewall problem) — Let's Encrypt: Fetching http://example.com/.well-known/acme-challenge/token: Timeout during connect (likely firewall problem) (SSL / TLS)Timeout during connec…UNABLE_TO_VERIFY_LEAF_SIGNATURE — Node.js: Error: unable to verify the first certificate (code: UNABLE_TO_VERIFY_LEAF_SIGNATURE) (SSL / TLS)UNABLE_TO_VERIFY_LEAF…wrong ver…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.