Skip to content

Commit 99d6f78

Browse files
bjornstardougwilson
authored andcommitted
Support Node.js 12.x
closes #2211
1 parent 4da394a commit 99d6f78

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ node_js:
1616
- "9.11"
1717
- "10.15"
1818
- "11.14"
19+
- "12.0"
1920
env:
2021
global:
2122
# Necessary to build Node.js 0.6 on Travis CI images

Changes.md

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ This file is a manually maintained list of changes for each release. Feel free
44
to add your changes here when sending pull requests. Also send corrections if
55
you spot any mistakes.
66

7+
## HEAD
8+
9+
* Support Node.js 12.x #2211
10+
711
## v2.17.1 (2019-04-18)
812

913
* Update `bignumber.js` to 7.2.1 #2206

appveyor.yml

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ environment:
2121
- nodejs_version: "9.11"
2222
- nodejs_version: "10.15"
2323
- nodejs_version: "11.14"
24+
- nodejs_version: "12.0"
2425

2526
services:
2627
- mysql

test/FakeServer.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ function FakeConnection(socket) {
5959
this.database = null;
6060
this.user = null;
6161

62+
this._cipher = null;
6263
this._socket = socket;
63-
this._ssl = null;
6464
this._stream = socket;
6565
this._parser = new Parser({onPacket: this._parsePacket.bind(this)});
6666

@@ -261,7 +261,7 @@ FakeConnection.prototype._handleQueryPacket = function _handleQueryPacket(packet
261261

262262
var writer = new PacketWriter();
263263
writer.writeLengthCodedString('Ssl_cipher');
264-
writer.writeLengthCodedString(this._ssl ? this._ssl.getCurrentCipher().name : '');
264+
writer.writeLengthCodedString(this._cipher ? this._cipher.name : '');
265265
this._stream.write(writer.toBuffer(this._parser));
266266

267267
this._sendPacket(new Packets.EofPacket());
@@ -343,7 +343,7 @@ FakeConnection.prototype._determinePacket = function _determinePacket() {
343343
var Packet = this._expectedNextPacket;
344344

345345
if (Packet === Packets.ClientAuthenticationPacket) {
346-
return !this._ssl && (this._parser.peak(1) << 8) & ClientConstants.CLIENT_SSL
346+
return !this._cipher && (this._parser.peak(1) << 8) & ClientConstants.CLIENT_SSL
347347
? Packets.SSLRequestPacket
348348
: Packets.ClientAuthenticationPacket;
349349
}
@@ -443,7 +443,7 @@ if (tls.TLSSocket) {
443443

444444
var conn = this;
445445
secureSocket.on('secure', function () {
446-
conn._ssl = this.ssl;
446+
conn._cipher = this.getCipher();
447447
});
448448

449449
// resume
@@ -472,7 +472,7 @@ if (tls.TLSSocket) {
472472

473473
var conn = this;
474474
securePair.on('secure', function () {
475-
conn._ssl = this.ssl;
475+
conn._cipher = securePair.cleartext.getCipher();
476476
});
477477

478478
// resume

0 commit comments

Comments
 (0)