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
Fixed gnutls support
This commit is contained in:
@@ -25,7 +25,7 @@ SET(API_TESTS "async" "basic-t" "fetch" "charset" "logs" "cursor" "errors" "view
|
||||
"sp" "result" "connection" "misc" "ps_new" "sqlite3" "thread" "dyncol")
|
||||
|
||||
# Get finger print from server certificate
|
||||
IF(WITH_OPENSSL)
|
||||
IF(WITH_SSL)
|
||||
|
||||
#create certificates
|
||||
IF(EXISTS "${CMAKE_SOURCE_DIR}/unittest/libmariadb/certs/server-cert.pem")
|
||||
|
@@ -33,8 +33,8 @@ pthread_mutex_t LOCK_test;
|
||||
|
||||
int check_skip_ssl()
|
||||
{
|
||||
#ifndef HAVE_OPENSSL
|
||||
diag("client library built without OpenSSL support -> skip");
|
||||
#ifndef HAVE_SSL
|
||||
diag("client library built without SSL support -> skip");
|
||||
return 1;
|
||||
#endif
|
||||
if (skip_ssl)
|
||||
@@ -92,7 +92,11 @@ static int test_ssl_cipher(MYSQL *unused)
|
||||
port, socketname, 0), mysql_error(my));
|
||||
|
||||
cipher= (char *)mysql_get_ssl_cipher(my);
|
||||
#ifdef HAVE_OPENSSL
|
||||
FAIL_IF(strcmp(cipher, "DHE-RSA-AES256-SHA") != 0, "Cipher != DHE-RSA-AES256-SHA");
|
||||
#elif defined(HAVE_HNUTLS)
|
||||
FAIL_IF(strcmp(cipher, "AES-256-CBC") != 0, "Cipher != AES-256-CBC");
|
||||
#endif
|
||||
mysql_close(my);
|
||||
return OK;
|
||||
}
|
||||
@@ -174,7 +178,11 @@ static int test_multi_ssl_connections(MYSQL *unused)
|
||||
}
|
||||
|
||||
cipher= (char *)mysql_get_ssl_cipher(mysql[i]);
|
||||
#ifdef HAVE_OPENSSL
|
||||
FAIL_IF(strcmp(cipher, "DHE-RSA-AES256-SHA") != 0, "Cipher != DHE-RSA-AES256-SHA");
|
||||
#elif defined(HAVE_HNUTLS)
|
||||
FAIL_IF(strcmp(cipher, "AES-256-CBC") != 0, "Cipher != AES-256-CBC");
|
||||
#endif
|
||||
}
|
||||
for (i=0; i < 50; i++)
|
||||
mysql_close(mysql[i]);
|
||||
@@ -637,7 +645,11 @@ static int test_ssl_fp(MYSQL *unused)
|
||||
port, socketname, 0), mysql_error(my));
|
||||
|
||||
cipher= (char *)mysql_get_ssl_cipher(my);
|
||||
#ifdef HAVE_OPENSSL
|
||||
FAIL_IF(strcmp(cipher, "DHE-RSA-AES256-SHA") != 0, "Cipher != DHE-RSA-AES256-SHA");
|
||||
#elif defined(HAVE_HNUTLS)
|
||||
FAIL_IF(strcmp(cipher, "AES-256-CBC") != 0, "Cipher != AES-256-CBC");
|
||||
#endif
|
||||
mysql_close(my);
|
||||
return OK;
|
||||
}
|
||||
@@ -660,8 +672,11 @@ static int test_ssl_fp_list(MYSQL *unused)
|
||||
FAIL_IF(!mysql_real_connect(my, hostname, ssluser, sslpw, schema,
|
||||
port, socketname, 0), mysql_error(my));
|
||||
|
||||
cipher= (char *)mysql_get_ssl_cipher(my);
|
||||
#ifdef HAVE_OPENSSL
|
||||
FAIL_IF(strcmp(cipher, "DHE-RSA-AES256-SHA") != 0, "Cipher != DHE-RSA-AES256-SHA");
|
||||
#elif defined(HAVE_HNUTLS)
|
||||
FAIL_IF(strcmp(cipher, "AES-256-CBC") != 0, "Cipher != AES-256-CBC");
|
||||
#endif
|
||||
mysql_close(my);
|
||||
return OK;
|
||||
}
|
||||
|
Reference in New Issue
Block a user