Skip to content

Commit 5a94570

Browse files
committedApr 5, 2023
Fix for CONC-635: Disable TLS/SSL for named pipe/shared mem
Since the server doesn't support secure connections for shared memory and named pipe connections but indicates this capability by setting the CLIENT_SSL flag, we unset this flag in case the connection uses shared memory or named pipe.
1 parent 2740335 commit 5a94570

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed
 

‎plugins/auth/my_auth.c

+10-2
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,6 @@ static int send_change_user_packet(MCPVIO_EXT *mpvio,
200200
return res;
201201
}
202202

203-
204-
205203
static int send_client_reply_packet(MCPVIO_EXT *mpvio,
206204
const uchar *data, int data_len)
207205
{
@@ -237,6 +235,16 @@ static int send_client_reply_packet(MCPVIO_EXT *mpvio,
237235
to unset CLIENT_CONNECT_WITH_DB flag */
238236
mysql->client_flag&= ~CLIENT_CONNECT_WITH_DB;
239237

238+
/* CONC-635: For connections via named pipe or shared memory the server
239+
indicates the capability for secure connections (TLS), but
240+
doesn't support it. */
241+
if ((mysql->server_capabilities & CLIENT_SSL) &&
242+
(mysql->net.pvio->type == PVIO_TYPE_NAMEDPIPE ||
243+
mysql->net.pvio->type == PVIO_TYPE_SHAREDMEM))
244+
{
245+
mysql->server_capabilities &= ~(CLIENT_SSL);
246+
}
247+
240248
/* if server doesn't support SSL and verification of server certificate
241249
was set to mandatory, we need to return an error */
242250
if (mysql->options.use_ssl && !(mysql->server_capabilities & CLIENT_SSL))

0 commit comments

Comments
 (0)
Please sign in to comment.