You've already forked mariadb-connector-c
mirror of
https://github.com/mariadb-corporation/mariadb-connector-c.git
synced 2025-08-08 14:02:17 +03:00
Text fixes:
Fixed windows test (missing parameter) Check if we need to connect via SSL port (Travis)
This commit is contained in:
@@ -2535,7 +2535,7 @@ static int test_conc760(MYSQL *my)
|
|||||||
mysql_options(mysql, MYSQL_OPT_PROTOCOL, &protocol);
|
mysql_options(mysql, MYSQL_OPT_PROTOCOL, &protocol);
|
||||||
|
|
||||||
if (!my_test_connect(mysql, hostname, username,
|
if (!my_test_connect(mysql, hostname, username,
|
||||||
password, schema, port, named_pipe_name, CLIENT_REMEMBER_OPTIONS))
|
password, schema, port, named_pipe_name, CLIENT_REMEMBER_OPTIONS, 0))
|
||||||
{
|
{
|
||||||
diag("error: %s", mysql_error(mysql));
|
diag("error: %s", mysql_error(mysql));
|
||||||
return FAIL;
|
return FAIL;
|
||||||
|
@@ -84,10 +84,13 @@ if (force_tls || fingerprint[0])\
|
|||||||
|
|
||||||
MYSQL *mysql_default = NULL; /* default connection */
|
MYSQL *mysql_default = NULL; /* default connection */
|
||||||
|
|
||||||
|
#define IS_MAXSCALE_ENV()\
|
||||||
|
(getenv("srv")!=NULL && (strcmp(getenv("srv"), "maxscale") == 0 ||\
|
||||||
|
strcmp(getenv("srv"), "skysql-ha") == 0))
|
||||||
|
|
||||||
#define IS_MAXSCALE()\
|
#define IS_MAXSCALE()\
|
||||||
((mysql_default && strstr(mysql_get_server_info(mysql_default), "maxScale")) ||\
|
((mysql_default && strstr(mysql_get_server_info(mysql_default), "maxScale")) ||\
|
||||||
(getenv("srv")!=NULL && (strcmp(getenv("srv"), "maxscale") == 0 ||\
|
IS_MAXSCALE_ENV())
|
||||||
strcmp(getenv("srv"), "skysql-ha") == 0)))
|
|
||||||
|
|
||||||
#define SKIP_MAXSCALE \
|
#define SKIP_MAXSCALE \
|
||||||
if (IS_MAXSCALE()) \
|
if (IS_MAXSCALE()) \
|
||||||
@@ -545,7 +548,7 @@ MYSQL *test_connect(struct my_tests_st *test)
|
|||||||
if (!(my_test_connect(mysql, hostname, username, password,
|
if (!(my_test_connect(mysql, hostname, username, password,
|
||||||
schema, port, socketname, (test) ? test->connect_flags:0, 1)))
|
schema, port, socketname, (test) ? test->connect_flags:0, 1)))
|
||||||
{
|
{
|
||||||
diag("Couldn't establish connection to server %s. Error (%d): %s",
|
diag("Couldn't establish connection to server %s. Error (%d): %s",
|
||||||
hostname, mysql_errno(mysql), mysql_error(mysql));
|
hostname, mysql_errno(mysql), mysql_error(mysql));
|
||||||
mysql_close(mysql);
|
mysql_close(mysql);
|
||||||
return(NULL);
|
return(NULL);
|
||||||
@@ -661,6 +664,7 @@ MYSQL *my_test_connect(MYSQL *mysql,
|
|||||||
my_bool auto_fingerprint)
|
my_bool auto_fingerprint)
|
||||||
{
|
{
|
||||||
char *have_fp;
|
char *have_fp;
|
||||||
|
my_bool verify= 0;
|
||||||
if (force_tls)
|
if (force_tls)
|
||||||
mysql_options(mysql, MYSQL_OPT_SSL_ENFORCE, &force_tls);
|
mysql_options(mysql, MYSQL_OPT_SSL_ENFORCE, &force_tls);
|
||||||
mysql_get_optionv(mysql, MARIADB_OPT_SSL_FP, &have_fp);
|
mysql_get_optionv(mysql, MARIADB_OPT_SSL_FP, &have_fp);
|
||||||
@@ -668,6 +672,14 @@ MYSQL *my_test_connect(MYSQL *mysql,
|
|||||||
{
|
{
|
||||||
mysql_options(mysql, MARIADB_OPT_SSL_FP, fingerprint);
|
mysql_options(mysql, MARIADB_OPT_SSL_FP, fingerprint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (IS_MAXSCALE_ENV())
|
||||||
|
{
|
||||||
|
mysql_get_optionv(mysql, MYSQL_OPT_SSL_VERIFY_SERVER_CERT, &verify);
|
||||||
|
if (force_tls || verify)
|
||||||
|
port= ssl_port;
|
||||||
|
}
|
||||||
|
|
||||||
if (!mysql_real_connect(mysql, host, user, passwd, db, port, unix_socket, clientflag))
|
if (!mysql_real_connect(mysql, host, user, passwd, db, port, unix_socket, clientflag))
|
||||||
{
|
{
|
||||||
diag("error: %s", mysql_error(mysql));
|
diag("error: %s", mysql_error(mysql));
|
||||||
|
Reference in New Issue
Block a user