-
Notifications
You must be signed in to change notification settings - Fork 1k
Avoid send close in ssl connections #5096
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
base: v3.0
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2958,7 +2958,7 @@ void MySQL_Connection::optimize() { | |
| // if avoids that a QUIT command stops forever | ||
| // FIXME: currently doesn't support encryption and compression | ||
| void MySQL_Connection::close_mysql() { | ||
| if ((send_quit) && (mysql->net.pvio) && ret_mysql) { | ||
| if ((send_quit) && (mysql->net.pvio) && ret_mysql && !mysql->options.use_ssl) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change correctly avoids sending an unencrypted if ((send_quit) && (mysql->net.pvio) && ret_mysql && !mysql->options.use_ssl && !mysql->options.compress) {
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. According to the comment that it does not work with compression this change would be fine but, since I have not tested it, I did not want to introduce it. If you can check it and it solves this issue, I see no problem in extending the patch. |
||
| char buff[5]; | ||
| mysql_hdr myhdr; | ||
| myhdr.pkt_id=0; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change correctly avoids sending an unencrypted
COM_QUITpacket over an SSL connection. To make this more robust, you could also check if compression is enabled, as sending an uncompressed packet on a compressed connection would also be incorrect. This would be consistent with a similarFIXMEcomment inlib/mysql_connection.cpp.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the comment that it does not work with compression this change would be fine but, since I have not tested it, I did not want to introduce it. If you can check it and it solves this issue, I see no problem in extending the patch.