Skip to content
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

deprecated library's warning using Amazon RDS mysql over ssl #363

Closed
carlok opened this issue Aug 3, 2016 · 11 comments · Fixed by #367
Closed

deprecated library's warning using Amazon RDS mysql over ssl #363

carlok opened this issue Aug 3, 2016 · 11 comments · Fixed by #367
Assignees

Comments

@carlok
Copy link

carlok commented Aug 3, 2016

Hi,
I get this warning

(node:621) DeprecationWarning: crypto.createCredentials is deprecated. Use tls.createSecureContext instead.

using this code derived from the example in the homepage

Running node --trace-deprecation, it seems the deprecation is in one of the following:

at PoolConnection._startTLS [as startTLS] (./node_modules/mysql2/lib/connection.js:188:27) at ClientHandshake.handshakeInit (./node_modules/mysql2/lib/commands/client_handshake.js:106:16) at ClientHandshake.Command.execute (./node_modules/mysql2/lib/commands/command.js:38:20) at PoolConnection.Connection.handlePacket (./node_modules/mysql2/lib/connection.js:261:28) at PacketParser.onPacket (./node_modules/mysql2/lib/connection.js:95:66) at PacketParser.executeStart (./node_modules/mysql2/lib/packet_parser.js:44:12) at Socket.<anonymous> (./node_modules/mysql2/lib/connection.js:97:29) at emitOne (events.js:96:13) at Socket.emit (events.js:188:7) at readableAddChunk (_stream_readable.js:177:18)

Is it possible to fix it (your side or me as a user)? Thanks.

@sidorares
Copy link
Owner

Hi @carlok , thanks for report! This needs to be fixed on the library side. Unfortunately tls is currently not covered with tests so issues like this are not very visible

@sidorares
Copy link
Owner

mysqljs/mysql@4b59612#commitcomment-5445205

related code in node-mysql:

https://github.com/mysqljs/mysql/blob/96fdd0566b654436624e2375c7b6604b1f50f825/lib/Connection.js#L290-L340

There is quite a bit of code to support node 0.10 - maybe it's a good time to drop support for node below < 0.12? ( It would still likely work on 0.10 if ssl not used ). Need to check current 0.10 usage

@carlok
Copy link
Author

carlok commented Aug 4, 2016

Well, IMHO if you are trying to use node-mysql2 (promises etc) then there is a very good chance that your node environment is not so old. I know that this is not a statistical answer but I'd drop it anyhow.

@sidorares
Copy link
Owner

Promises are very optional, and CI matrix still has 0.8 (which is probably very safe to drop)

This is end of 2015 - https://semaphoreci.com/blog/2015/12/15/nodejs-version-usage-in-commercial-projects-2015-edition.html

@carlok
Copy link
Author

carlok commented Aug 4, 2016

Thank you for the link. Anyhow, using MySQL on AWS/SSL and getting a warning in the server console for each query is not a nice thing ;-(

@sidorares
Copy link
Owner

According to https://github.com/nodejs/LTS node 0.10 official end of life is Oct 2016. I guess I'll add code similar to one in node-mysql ( two code branches, pre 0.11 and current node ) and then later remove pre 0.11 code after Oct 2016. Also end of Dec 2016 we'll drop node 0.12

@sidorares
Copy link
Owner

Anyhow, using MySQL on AWS/SSL and getting a warning in the server console for each query is not a nice thing ;-(

I'll try to fix as soon as I have time ( you are welcome to do this as well ;) )

@carlok
Copy link
Author

carlok commented Aug 4, 2016

Well, October is fine. I can wait. Thanks. I'd help but I think I'm not smart enough.

@sidorares
Copy link
Owner

Btw "getting a warning in the server console for each query " means that you are likely making new connection on each request ( which is quite cpu and latency expensive, especially with ssl ). Any reason why you are not using connection pool?

@carlok
Copy link
Author

carlok commented Aug 4, 2016

Yes I want to use connection pool but I'm still playing a bit with the library. Maybe I'll write again after having written a more stable/good code.

@sidorares
Copy link
Owner

ping me if you need any help with that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants