Open digidax opened 4 years ago
The ER_HANDSHAKE_ERROR: Bad handshake is actually coming from the mysql server itself, not this module. So there is something about the handshake packet this module is producing that the server it is connecting to does not like. You can see in your trace the last thing is the server sending an error packet with "Bad handshake".
The question is, though, why is the server rejecting the handshake from this client? Unfortunately it is not something I am able to answer. Is there documentation somewhere on "Node Red mysql-node" that explains what it needs in the handshake?
Ok, sorry, I see you are saying that "Node Red mysql-node" is using this module to connect to a database. I presume that is a vanilla mysql 5.0.77 install from Oracle? If so, it is likely this module does not support that old of a mysql server version. It is not tested in CI, at least.
It's a mysql from CentOS 5 repo, I have update it to 5.0.95 without any success. A php application uses this server and some perl clients, also some bash scripts. Also in the same machine where node red connects with the mysqljs lib is installed mysql client as Ver 15.1 Distrib 5.5.64-MariaDB (CentOS 7) and it can login without any problems.
Here is the dump:
Frame 4: 128 bytes on wire (1024 bits), 128 bytes captured (1024 bits)
Linux cooked capture
Internet Protocol Version 4, Src: 192.168.130.188, Dst: 192.168.130.172
Transmission Control Protocol, Src Port: 3306, Dst Port: 39984, Seq: 1, Ack: 1, Len: 60
MySQL Protocol
Packet Length: 56
Packet Number: 0
Server Greeting
Protocol: 10
Version: 5.0.95-log
Thread ID: 191305
Salt: }[/w.x8K
Server Capabilities: 0xa22c
Server Language: latin1 COLLATE latin1_swedish_ci (8)
Server Status: 0x0002
Extended Server Capabilities: 0x0000
Authentication Plugin Length: 0
Unused: 00000000000000000000
Salt: Q3K_|qECa>OS
Frame 19: 130 bytes on wire (1040 bits), 130 bytes captured (1040 bits)
Linux cooked capture
Internet Protocol Version 4, Src: 192.168.130.172, Dst: 192.168.130.188
Transmission Control Protocol, Src Port: 40108, Dst Port: 3306, Seq: 1, Ack: 61, Len: 62
MySQL Protocol
Packet Length: 58
Packet Number: 1
Login Request
Client Capabilities: 0xa685
Extended Client Capabilities: 0x200f
MAX Packet: 16777216
Charset: latin1 COLLATE latin1_swedish_ci (8)
Username: xxxxxxxx
Password: xxxxxxx
Client Auth Plugin:
Frame 21: 73 bytes on wire (584 bits), 73 bytes captured (584 bits)
Linux cooked capture
Internet Protocol Version 4, Src: 192.168.130.188, Dst: 192.168.130.172
Transmission Control Protocol, Src Port: 3306, Dst Port: 40108, Seq: 61, Ack: 63, Len: 5
MySQL Protocol
Packet Length: 1
Packet Number: 2
EOF marker: 254
[Expert Info (Warning/Protocol): EOF Marker found while connection in wrong state.]
[EOF Marker found while connection in wrong state.]
[Severity level: Warning]
[Group: Protocol]
Frame 22: 81 bytes on wire (648 bits), 81 bytes captured (648 bits)
Linux cooked capture
Internet Protocol Version 4, Src: 192.168.130.172, Dst: 192.168.130.188
Transmission Control Protocol, Src Port: 40108, Dst Port: 3306, Seq: 63, Ack: 66, Len: 13
MySQL Protocol
Packet Length: 9
Packet Number: 3
Request Command Unknown (84)
Command: Unknown (84)
Payload: 505848475a4e5600
[Expert Info (Warning/Protocol): Unknown/invalid command code]
[Unknown/invalid command code]
[Severity level: Warning]
[Group: Protocol]
Frame 23: 79 bytes on wire (632 bits), 79 bytes captured (632 bits)
Linux cooked capture
Internet Protocol Version 4, Src: 192.168.130.188, Dst: 192.168.130.172
Transmission Control Protocol, Src Port: 3306, Dst Port: 40108, Seq: 66, Ack: 76, Len: 11
MySQL Protocol
Packet Length: 7
Packet Number: 4
Affected Rows: 0
Server Status: 0x0002
.... .... .... ...0 = In transaction: Not set
.... .... .... ..1. = AUTO_COMMIT: Set
.... .... .... .0.. = More results: Not set
.... .... .... 0... = Multi query - more resultsets: Not set
.... .... ...0 .... = Bad index used: Not set
.... .... ..0. .... = No index used: Not set
.... .... .0.. .... = Cursor exists: Not set
.... .... 0... .... = Last row sent: Not set
.... ...0 .... .... = database dropped: Not set
.... ..0. .... .... = No backslash escapes: Not set
.... .0.. .... .... = Session state changed: Not set
.... 0... .... .... = Query was slow: Not set
...0 .... .... .... = PS Out Params: Not set
Warnings: 0
Right, I'm just saying that it is likely an issue with this module since it is untested in such old mysql server versions. Someone would need to investigate and fix the issue. I will try at some point, but of course pull requests are welcome if you are looking for a fix on some specific timeline.
Ok, thanks for taking time. I will discuss here to migrate to an actual MySQL / MariaDB Version.
Thank, Frank
Hello,
I am getting a similar issue.
I am using SSL Profile of Amazon RDS
.
Our Aurora Postgres Cluster in AWS RDS was due maintenance. We updated it and it now has a new cert. Even since then, we have been getting below error when using the Amazon RDS
profile. Can we please have a look.
Cannot connect to Database
2020-01-14 14:43:35{ Error: unable to get local issuer certificate
2020-01-14 14:43:35at TLSSocket.
Here is an article of AWS RDS Cert Updates
https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL-certificate-rotation.html
@ksaleemL1 unless your error is _HANDSHAKE_ERROR: Bad handshake
, it is not related, and so I'm hiding your posts so this issue can remain about the specific issue of _HANDSHAKE_ERROR: Bad handshake
error.
Do you want me to create a new issue for this?
From: Douglas Wilson notifications@github.com Reply-To: mysqljs/mysql reply@reply.github.com Date: Wednesday, January 15, 2020 at 1:32 PM To: mysqljs/mysql mysql@noreply.github.com Cc: Khurram Saleem KSaleem@loyalty.com, Mention mention@noreply.github.com Subject: Re: [mysqljs/mysql] Error: ER_HANDSHAKE_ERROR: Bad handshake (#2287)
@ksaleemL1https://github.com/ksaleemL1 unless your error is _HANDSHAKE_ERROR: Bad handshake, it is not related, and so I'm hiding your posts so this issue can remain about the specific issue of _HANDSHAKE_ERROR: Bad handshake error.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/mysqljs/mysql/issues/2287?email_source=notifications&email_token=AFIPZOY6AHGOAID2ZVCOWBLQ55JD7A5CNFSM4KHBHXQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJBKFFI#issuecomment-574792341, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AFIPZO7FN6CJVHCHEI5TJI3Q55JD7ANCNFSM4KHBHXQQ.
The information contained in this e-mail message and any attachments is confidential. If the reader of this message is not the intended recipient or an agent responsible for delivering it to the intended recipient, you are hereby notified that any review, dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the sender immediately by replying to this e-mail and delete the message and any attachments from your computer.
We have tested serveral things, without any success. Are any additional information required which are not posted in the node red forum thread?
@digidax What version of nodejs does your program run on?
Sorry @CovertLeopard, this is unfortunately no longer found because in the last weeks are done several npn updates. I can't not name exactly the version number. But I have tested with 5.5.61-MariaDB-38.13 successful and we're planning a very large migration process for the future. Instead of MySQL I'm using now InfluxDB.
Mysqljs is used in Node Red mysql-node. We have here a discussion about the Error: ER_HANDSHAKE_ERROR https://discourse.nodered.org/t/node-red-node-mysql-0-0-19-er-handshake-error-bad-handshake/20098
MySQL conversion dump:
We have tested serveral things, without any success. Are any additional information required which are not posted in the node red forum thread?
Thanks a lot, Frank