From 206146803c9a04519874913f7b98413130594763 Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson Date: Tue, 13 Nov 2018 22:40:51 -0500 Subject: [PATCH] Fix compression over SSL --- lib/protocol/sequences/Handshake.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/protocol/sequences/Handshake.js b/lib/protocol/sequences/Handshake.js index 0acfa0b51..5809e3487 100644 --- a/lib/protocol/sequences/Handshake.js +++ b/lib/protocol/sequences/Handshake.js @@ -57,6 +57,10 @@ Handshake.prototype['HandshakeInitializationPacket'] = function(packet) { this._config.protocol41 = packet.protocol41; + if (this._config.compress && packet.hasCapabilityFlag(ClientConstants.CLIENT_COMPRESS)) { + this._config.clientFlags |= ClientConstants.CLIENT_COMPRESS; + } + if (this._config.ssl) { if (!packet.hasCapabilityFlag(ClientConstants.CLIENT_SSL)) { var err = new Error('Server does not support secure connection'); @@ -87,10 +91,6 @@ Handshake.prototype._tlsUpgradeCompleteHandler = function() { Handshake.prototype._sendCredentials = function() { var packet = this._handshakeInitializationPacket; - if (this._config.compress && packet.hasCapabilityFlag(ClientConstants.CLIENT_COMPRESS)) { - this._config.clientFlags |= ClientConstants.CLIENT_COMPRESS; - } - this.emit('packet', new Packets.ClientAuthenticationPacket({ clientFlags : this._config.clientFlags, maxPacketSize : this._config.maxPacketSize,