SSL - SSLHandshakeException: Unrecognized SSL message, plaintext connection?

襲冷發表於2018-08-27

一、異常日誌

 

javax.net.ssl.SSLHandshakeException: SSL handshake failed.
    Caused by: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
        at com.sun.net.ssl.internal.ssl.EngineInputRecord.bytesInCompletePacket(EngineInputRecord.java:152)
        at com.sun.net.ssl.internal.ssl.SSLEngineImpl.readNetRecord(SSLEngineImpl.java:806)
        at com.sun.net.ssl.internal.ssl.SSLEngineImpl.unwrap(SSLEngineImpl.java:721)
        at javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:607)
        at org.apache.mina.filter.ssl.SslHandler.unwrap(SslHandler.java:725)
        at org.apache.mina.filter.ssl.SslHandler.unwrapHandshake(SslHandler.java:663)
        at org.apache.mina.filter.ssl.SslHandler.handshake(SslHandler.java:549)
        at org.apache.mina.filter.ssl.SslHandler.messageReceived(SslHandler.java:349)
        at org.apache.mina.filter.ssl.SslFilter.messageReceived(SslFilter.java:476)
        ... 15 more

 

二、問題原因

    客戶端產生該異常,是因為對方提供的不是 https 服務的埠
    服務端產生該異常,是因為客戶端以 http 協議訪問服務端的 https 服務

 

 

 

相關文章