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

Java: SSLException — Unrecognized SSL message, plaintext connection? (HTTPS client talking to an HTTP port)

The client expects TLS, but the server answered with plain text, so the handshake can't start.

Exact message you may see Unrecognized SSL message, plaintext connection?javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?SSLException: Unsupported or unrecognized SSL messageplaintext connection? TLS
Seen on: Java SSL

Meaning

You are using https:// or SSL on a port that speaks plain HTTP/SMTP (e.g. 8080, 587 with STARTTLS instead of implicit TLS). Use the right port/scheme, or enable TLS on the server; for SMTP use STARTTLS on 587 and implicit TLS on 465.

Common causes

  • https:// against an HTTP-only port
  • Implicit SSL on a STARTTLS port (SMTP 587)
  • Proxy returning a plain-text error
  • Wrong protocol setting in the client
  • Server not configured for TLS

⚡ Quick fix

  1. Use http:// or enable TLS on the server port
  2. SMTP: 465 = SSL, 587 = STARTTLS
  3. Test the port with curl -v

Detailed fix by platform

Shell

  1. bash
    curl -v http://host:8080/
    openssl s_client -connect host:8080

How to diagnose

  1. Port — TLS or plain?
  2. Scheme — Correct?
  3. STARTTLS — Needed?

🔧 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):

cipher suites — Java: SSLHandshakeException — no cipher suites in common (server side) (SSL / TLS)cipher suitesDjango — Django send_mail: ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] (EMAIL_USE_SSL vs EMAIL_USE_TLS on the wrong port) (Email / SMTP)Djangohostname — Java: SSLPeerUnverifiedException — Certificate for <host> doesn't match any of the subject alternative names (SSL / TLS)hostnameICMP Destination unreachable (Port unreachable) — Networking: ICMP Destination unreachable (Port unreachable) — UDP packet sent to a port where nothing is listening (Networking)ICMP Destination unre…JavaMail — javax.mail.MessagingException: Could not connect to SMTP host: smtp.example.com, port: 587 (JavaMail) (Email / SMTP)JavaMailNo subject alternative names present — Java: javax.net.ssl.SSLHandshakeException: No subject alternative names matching IP address 10.0.0.5 found (SSL / TLS)No subject alternativ…Received fatal alert: handshake_failure — Java: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure (SSL / TLS)Received fatal alert:…SSL routines: wrong version number — OpenSSL: error:1408F10B:SSL routines:ssl3_get_record:wrong version number (SSL / TLS)SSL routines: wrong v…plaintext

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.