@@ -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