You've already forked mariadb-connector-c
mirror of
https://github.com/mariadb-corporation/mariadb-connector-c.git
synced 2025-08-07 02:42:49 +03:00
Travis fix:
When reading connection parameters from configuration file a secure connection must be established.
This commit is contained in:
@@ -2018,15 +2018,25 @@ static int test_conn_str_1(MYSQL *my __attribute__((unused)))
|
||||
MYSQL *mysql;
|
||||
FILE *fp;
|
||||
int rc;
|
||||
char conn_str[1024];
|
||||
mysql= mysql_init(NULL);
|
||||
|
||||
if (!(fp= fopen("./conc274.cnf", "w")))
|
||||
return FAIL;
|
||||
|
||||
fprintf(fp, "[client]\n");
|
||||
fprintf(fp, "connection=host=%s;user=%s;password=%s;port=%d;ssl_enforce=1;socket=%s\n",
|
||||
sprintf(conn_str, "connection=host=%s;user=%s;password=%s;port=%d;ssl_enforce=1;socket=%s",
|
||||
hostname ? hostname : "localhost", username ? username : "",
|
||||
password ? password : "", port, socketname ? socketname : "");
|
||||
|
||||
/* SkySQL requires secure connection */
|
||||
if (IS_SKYSQL(hostname))
|
||||
{
|
||||
strcat(conn_str, ";ssl_enforce=1");
|
||||
}
|
||||
|
||||
fprintf(fp, "[client]\n");
|
||||
fprintf(fp, "%s\n", conn_str);
|
||||
|
||||
fclose(fp);
|
||||
|
||||
rc= mysql_options(mysql, MYSQL_READ_DEFAULT_FILE, "./conc274.cnf");
|
||||
|
Reference in New Issue
Block a user