Skip to content

Commit

Permalink
Fix compression over SSL
Browse files Browse the repository at this point in the history
  • Loading branch information
dougwilson committed Nov 14, 2018
1 parent b8a52e8 commit 2061468
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/protocol/sequences/Handshake.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 2061468

Please sign in to comment.