Skip to content

Unrecognized SSL message, plaintext connection? #983

Description

@Orscrider

I setup a simple HTTPS server with a custom certificate using the Java SE 2.2 framework. Whenever I try to connect to the server through a browser (haven't tried the client API yet), it can't connect and throws the following error (not on default debug level):

javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
    at sun.security.ssl.EngineInputRecord.bytesInCompletePacket(EngineInputRecord.java:156)
    at sun.security.ssl.SSLEngineImpl.readNetRecord(SSLEngineImpl.java:862)
    at sun.security.ssl.SSLEngineImpl.unwrap(SSLEngineImpl.java:775)
    at javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:624)
    at sun.net.httpserver.SSLStreams$EngineWrapper.recvAndUnwrap(SSLStreams.java:338)
    at sun.net.httpserver.SSLStreams.recvData(SSLStreams.java:406)
    at sun.net.httpserver.SSLStreams$InputStream.read(SSLStreams.java:522)
    at sun.net.httpserver.SSLStreams$InputStream.read(SSLStreams.java:591)
    at sun.net.httpserver.Request.readLine(Request.java:80)
    at sun.net.httpserver.Request.<init>(Request.java:50)
    at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:536)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

HTTP works fine. The first time I tried it, I trusted the certificate and it worked though. Btw is there a way to guard everything with one guard?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions