@@ -112,8 +112,6 @@ protected int doHandshake(@NotNull ByteBuffer receivedBuffer, int receivedBytes)
112112 }
113113
114114 sslEngine .closeOutbound ();
115- // After closeOutbound the engine will be set to WRAP state,
116- // in order to try to send a close message to the client.
117115 handshakeStatus = sslEngine .getHandshakeStatus ();
118116 break ;
119117
@@ -129,7 +127,6 @@ protected int doHandshake(@NotNull ByteBuffer receivedBuffer, int receivedBytes)
129127 } catch (SSLException sslException ) {
130128 LOGGER .error ("A problem was encountered while processing the data that caused the " +
131129 "SSLEngine to abort. Will try to properly close connection..." );
132- LOGGER .error (sslException );
133130 sslEngine .closeOutbound ();
134131 handshakeStatus = sslEngine .getHandshakeStatus ();
135132 break ;
@@ -139,7 +136,7 @@ protected int doHandshake(@NotNull ByteBuffer receivedBuffer, int receivedBytes)
139136 case OK :
140137 break ;
141138 case BUFFER_OVERFLOW :
142- throw new IllegalStateException ("Unexpected state " );
139+ throw new IllegalStateException ("Unexpected ssl engine result " );
143140 case BUFFER_UNDERFLOW :
144141 LOGGER .debug ("Increase ssl network buffer" );
145142 increaseNetworkBuffer ();
@@ -194,6 +191,7 @@ protected int decryptAndRead(@NotNull ByteBuffer receivedBuffer) {
194191
195192 SSLEngineResult result ;
196193 try {
194+ LOGGER .debug (receivedBuffer , buf -> "Try to decrypt data:\n " + hexDump (buf ));
197195 result = sslEngine .unwrap (receivedBuffer , sslDataBuffer .clear ());
198196 } catch (SSLException e ) {
199197 if (e .getCause () instanceof BadPaddingException ) {
0 commit comments