Skip to content

Commit 6a396c6

Browse files
authored
Fix searchd connection with newer MariaDB Connector/C (#483)
1 parent f300288 commit 6a396c6

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/mysql.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,14 @@ int open_sphx(struct session_data *sdata, struct config *cfg){
3939

4040
mysql_init(&(sdata->sphx));
4141

42+
/*
43+
* searchd speaks the MySQL protocol but does not support TLS.
44+
* Newer MariaDB Connector/C versions enable server certificate
45+
* verification by default, causing mysql_real_connect() to fail.
46+
*/
47+
unsigned int verify = 0;
48+
mysql_options(&(sdata->sphx), MYSQL_OPT_SSL_VERIFY_SERVER_CERT, &verify);
49+
4250
mysql_options(&(sdata->sphx), MYSQL_OPT_CONNECT_TIMEOUT, (const char*)&cfg->mysql_connect_timeout);
4351
mysql_options(&(sdata->sphx), MYSQL_OPT_RECONNECT, (const char*)&rc);
4452

0 commit comments

Comments
 (0)