1
0
mirror of https://github.com/mariadb-corporation/mariadb-connector-c.git synced 2025-08-08 14:02:17 +03:00

CONC-403:

Remove support of TLSv1.0 protocol
This commit is contained in:
Georg Richter
2024-02-20 09:52:07 +01:00
parent 5a5a7275bd
commit fe411bf336
4 changed files with 34 additions and 10 deletions

View File

@@ -1628,7 +1628,37 @@ static int test_ext_field_attr(MYSQL *mysql)
return OK;
}
static int test_disable_tls1_0(MYSQL *my)
{
MYSQL *mysql= mysql_init(NULL);
const char *disabled_version= "TLSv1.0";
MYSQL_RES *result;
MYSQL_ROW row;
int rc;
mysql_ssl_set(mysql, NULL, NULL, NULL, NULL, NULL);
mysql_optionsv(mysql, MARIADB_OPT_TLS_VERSION, disabled_version);
FAIL_IF(!mysql_real_connect(mysql, hostname, username, password, schema,
port, socketname, 0), mysql_error(mysql));
rc= mysql_query(mysql, "SHOW STATUS LIKE 'ssl_version'");
check_mysql_rc(rc, mysql);
result = mysql_store_result(mysql);
row= mysql_fetch_row(result);
FAIL_IF(!strcmp(row[1], "TLSv1.0"), "TLS 1.0 should be disabled!");
mysql_free_result(result);
mysql_close(mysql);
return OK;
}
struct my_tests_st my_tests[] = {
{"test_disable_tls1_0", test_disable_tls1_0, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},
{"test_ext_field_attr", test_ext_field_attr, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},
{"test_conc533", test_conc533, TEST_CONNECTION_NEW, 0, NULL, NULL},
{"test_conc458", test_conc458, TEST_CONNECTION_NONE, 0, NULL, NULL},