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 fix: Avoid crash in non TLS connections
This commit is contained in:
@@ -681,7 +681,7 @@ void run_tests(struct my_tests_st *test) {
|
|||||||
int i, rc, total=0;
|
int i, rc, total=0;
|
||||||
MYSQL *mysql;
|
MYSQL *mysql;
|
||||||
my_bool verify= 0;
|
my_bool verify= 0;
|
||||||
MARIADB_X509_INFO *info;
|
MARIADB_X509_INFO *info= NULL;
|
||||||
|
|
||||||
while (test[total].function)
|
while (test[total].function)
|
||||||
total++;
|
total++;
|
||||||
@@ -710,11 +710,15 @@ void run_tests(struct my_tests_st *test) {
|
|||||||
while ((row= mysql_fetch_row(res)))
|
while ((row= mysql_fetch_row(res)))
|
||||||
diag("%s: %s", row[0], row[1]);
|
diag("%s: %s", row[0], row[1]);
|
||||||
mysql_free_result(res);
|
mysql_free_result(res);
|
||||||
diag("Cipher in use: %s", mysql_get_ssl_cipher(mysql));
|
if (mysql_get_ssl_cipher(mysql))
|
||||||
|
diag("Cipher in use: %s", mysql_get_ssl_cipher(mysql));
|
||||||
mariadb_get_infov(mysql, MARIADB_TLS_PEER_CERT_INFO, &info);
|
mariadb_get_infov(mysql, MARIADB_TLS_PEER_CERT_INFO, &info);
|
||||||
strcpy(fingerprint, info->fingerprint);
|
if (info)
|
||||||
diag("Peer certificate fingerprint: %s", fingerprint);
|
{
|
||||||
diag("--------------------");
|
strcpy(fingerprint, info->fingerprint);
|
||||||
|
diag("Peer certificate fingerprint: %s", fingerprint);
|
||||||
|
diag("--------------------");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
mysql_close(mysql);
|
mysql_close(mysql);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user