From 99d6f78ba00f926de162dbef42865029b6e8ec39 Mon Sep 17 00:00:00 2001 From: Bjorn Stromberg Date: Thu, 25 Apr 2019 14:03:42 +0900 Subject: [PATCH] Support Node.js 12.x closes #2211 --- .travis.yml | 1 + Changes.md | 4 ++++ appveyor.yml | 1 + test/FakeServer.js | 10 +++++----- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 17a7972c9..4f197d769 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,6 +16,7 @@ node_js: - "9.11" - "10.15" - "11.14" + - "12.0" env: global: # Necessary to build Node.js 0.6 on Travis CI images diff --git a/Changes.md b/Changes.md index 87535a5fc..452f4faff 100644 --- a/Changes.md +++ b/Changes.md @@ -4,6 +4,10 @@ This file is a manually maintained list of changes for each release. Feel free to add your changes here when sending pull requests. Also send corrections if you spot any mistakes. +## HEAD + +* Support Node.js 12.x #2211 + ## v2.17.1 (2019-04-18) * Update `bignumber.js` to 7.2.1 #2206 diff --git a/appveyor.yml b/appveyor.yml index 97b7073ff..8e74d1eed 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -21,6 +21,7 @@ environment: - nodejs_version: "9.11" - nodejs_version: "10.15" - nodejs_version: "11.14" + - nodejs_version: "12.0" services: - mysql diff --git a/test/FakeServer.js b/test/FakeServer.js index cfbd96c04..f7a367518 100644 --- a/test/FakeServer.js +++ b/test/FakeServer.js @@ -59,8 +59,8 @@ function FakeConnection(socket) { this.database = null; this.user = null; + this._cipher = null; this._socket = socket; - this._ssl = null; this._stream = socket; this._parser = new Parser({onPacket: this._parsePacket.bind(this)}); @@ -261,7 +261,7 @@ FakeConnection.prototype._handleQueryPacket = function _handleQueryPacket(packet var writer = new PacketWriter(); writer.writeLengthCodedString('Ssl_cipher'); - writer.writeLengthCodedString(this._ssl ? this._ssl.getCurrentCipher().name : ''); + writer.writeLengthCodedString(this._cipher ? this._cipher.name : ''); this._stream.write(writer.toBuffer(this._parser)); this._sendPacket(new Packets.EofPacket()); @@ -343,7 +343,7 @@ FakeConnection.prototype._determinePacket = function _determinePacket() { var Packet = this._expectedNextPacket; if (Packet === Packets.ClientAuthenticationPacket) { - return !this._ssl && (this._parser.peak(1) << 8) & ClientConstants.CLIENT_SSL + return !this._cipher && (this._parser.peak(1) << 8) & ClientConstants.CLIENT_SSL ? Packets.SSLRequestPacket : Packets.ClientAuthenticationPacket; } @@ -443,7 +443,7 @@ if (tls.TLSSocket) { var conn = this; secureSocket.on('secure', function () { - conn._ssl = this.ssl; + conn._cipher = this.getCipher(); }); // resume @@ -472,7 +472,7 @@ if (tls.TLSSocket) { var conn = this; securePair.on('secure', function () { - conn._ssl = this.ssl; + conn._cipher = securePair.cleartext.getCipher(); }); // resume