Fix starttls support. Now SslHandler should be fully functional again
This commit is contained in:
parent
fd7767ccda
commit
f759d30538
@ -168,7 +168,7 @@ public class SslHandler extends StreamToStreamCodec {
|
|||||||
|
|
||||||
// TODO: Fix STARTTLS
|
// TODO: Fix STARTTLS
|
||||||
private final boolean startTls;
|
private final boolean startTls;
|
||||||
private boolean firstMessageSend;
|
private boolean sentFirstMessage;
|
||||||
|
|
||||||
private volatile boolean enableRenegotiation = true;
|
private volatile boolean enableRenegotiation = true;
|
||||||
|
|
||||||
@ -449,6 +449,15 @@ public class SslHandler extends StreamToStreamCodec {
|
|||||||
@Override
|
@Override
|
||||||
public void encode(ChannelOutboundHandlerContext<Byte> ctx, ChannelBuffer in, ChannelBuffer out) throws Exception {
|
public void encode(ChannelOutboundHandlerContext<Byte> ctx, ChannelBuffer in, ChannelBuffer out) throws Exception {
|
||||||
|
|
||||||
|
|
||||||
|
// Do not encrypt the first write request if this handler is
|
||||||
|
// created with startTLS flag turned on.
|
||||||
|
if (startTls && !sentFirstMessage) {
|
||||||
|
sentFirstMessage = true;
|
||||||
|
out.writeBytes(in);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
ByteBuffer outNetBuf = bufferPool.acquireBuffer();
|
ByteBuffer outNetBuf = bufferPool.acquireBuffer();
|
||||||
boolean success = true;
|
boolean success = true;
|
||||||
boolean needsUnwrap = false;
|
boolean needsUnwrap = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user