Skip to content

Commit

Permalink
Disable SSL and Compression for UNIX Socket
Browse files Browse the repository at this point in the history
  • Loading branch information
rahim-kanji committed May 11, 2023
1 parent 3865c81 commit cd352ff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/MySQL_Monitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1501,7 +1501,7 @@ bool MySQL_Monitor_State_Data::set_wait_timeout() {
bool MySQL_Monitor_State_Data::create_new_connection() {
mysql=mysql_init(NULL);
assert(mysql);
if (use_ssl) {
if (use_ssl && port) {
mysql_ssl_set(mysql,
mysql_thread___ssl_p2s_key,
mysql_thread___ssl_p2s_cert,
Expand Down
3 changes: 2 additions & 1 deletion lib/mysql_connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ void MySQL_Connection::connect_start() {
}
mysql_options4(mysql, MYSQL_OPT_CONNECT_ATTR_ADD, "mysql_bug_102266", "Avoid MySQL bug https://bugs.mysql.com/bug.php?id=102266 , https://github.com/sysown/proxysql/issues/3276");
}
if (parent->use_ssl) {
if (parent->use_ssl && parent->port) {
mysql_ssl_set(mysql,
mysql_thread___ssl_p2s_key,
mysql_thread___ssl_p2s_cert,
Expand Down Expand Up @@ -857,6 +857,7 @@ void MySQL_Connection::connect_start() {

async_exit_status=mysql_real_connect_start(&ret_mysql, mysql, host_ip, userinfo->username, auth_password, userinfo->schemaname, parent->port, NULL, client_flags);
} else {
client_flags &= ~(CLIENT_COMPRESS); // disabling compression for connections made via Unix socket
async_exit_status=mysql_real_connect_start(&ret_mysql, mysql, "localhost", userinfo->username, auth_password, userinfo->schemaname, parent->port, parent->address, client_flags);
}
fd=mysql_get_socket(mysql);
Expand Down

0 comments on commit cd352ff

Please sign in to comment.