Skip to content

Cannot connect using node 0.10.5 #746

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
klaussfreire opened this issue Feb 28, 2014 · 5 comments
Closed

Cannot connect using node 0.10.5 #746

klaussfreire opened this issue Feb 28, 2014 · 5 comments
Assignees
Labels

Comments

@klaussfreire
Copy link

It seems commit 0c44758 broke authentication ni node 0.10.5, whose sha1 digest function still doesn't return a Buffer.

Reverting to pre - 0c44758 fixes that issue

See:

var Crypto = require("crypto");
undefined
var hash = Crypto.createHash("sha1");
undefined
hash.update("bloo")
{ _binding: {}, _options: undefined }
hash.digest("binary");
'¸ð#&¢1\u0010g®]\u001cBN jÁá'

@dougwilson
Copy link
Member

Hi! It looks like you may have pasted the wrong commit. Are you referring to commit fe4c2f5 ?

@klaussfreire
Copy link
Author

Indeed, dunno how copypaste bit me, but bit me it did

@dougwilson
Copy link
Member

That's OK, I just wanted to make sure we started looking in the right place :)

@dougwilson
Copy link
Member

OK, it looks like you may need to use node.js 0.10.7 or higher for 0.10.x releases; I'll see about getting support added back for node.js >= 0.10.0 < 0.10.7

@dougwilson dougwilson self-assigned this Mar 6, 2014
@dougwilson dougwilson added the bug label Mar 6, 2014
@dougwilson
Copy link
Member

Running authentication on node.js 0.10.1 results in the following error:

  TypeError: Cannot set property 'decoder' of undefined
      at Hash.Readable.setEncoding (_stream_readable.js:170:31)
      at sha1 (/app/app/mysql/node-mysql-master/lib/protocol/Auth.js:9:10)
      at Object.Auth.token (/app/app/mysql/node-mysql-master/lib/protocol/Auth.js:41:16)
      at Handshake._sendCredentials (/app/app/mysql/node-mysql-master/lib/protocol/sequences/Handshake.js:64:29)
      at Handshake.HandshakeInitializationPacket (/app/app/mysql/node-mysql-master/lib/protocol/sequences/Handshake.js:48:10)
      at Protocol._parsePacket (/app/app/mysql/node-mysql-master/lib/protocol/Protocol.js:202:24)
      at Parser.write (/app/app/mysql/node-mysql-master/lib/protocol/Parser.js:62:12)
      at Protocol.write (/app/app/mysql/node-mysql-master/lib/protocol/Protocol.js:37:16)
      at Socket.<anonymous> (/app/app/mysql/node-mysql-master/lib/Connection.js:72:28)
      at Socket.EventEmitter.emit (events.js:95:17)

dougwilson added a commit that referenced this issue Mar 12, 2014
This switches node.js 0.10 back to the old sha1 function due to
some bugs in early node.js 0.10 versions.

node.js >= 0.10.0 < 0.10.5 throw an error from `hash.setEncoding`
node.js 0.10.5 does not honor `hash.setEncoding` for `hash.write`
and the string is interpreted as utf8 and corrupted.

fixes #746
fixes #752
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants