Don't assume source and binary directories are the same
Some of the scripts assumed that other scripts would be located in the same directory where the current script was executed. Also fixed the SSL connection creation which depended on an obsolete environment variable causing all out-of-source SSL tests to fail.
This commit is contained in:
@ -12,6 +12,7 @@
|
||||
|
||||
|
||||
#include "mariadb_func.h"
|
||||
#include "templates.h"
|
||||
#include <ctype.h>
|
||||
#include <sstream>
|
||||
|
||||
@ -20,20 +21,11 @@ int set_ssl(MYSQL* conn)
|
||||
char client_key[1024];
|
||||
char client_cert[1024];
|
||||
char ca[1024];
|
||||
char* test_dir = getenv("test_dir");
|
||||
|
||||
if (test_dir == NULL)
|
||||
{
|
||||
sprintf(client_key, "./ssl-cert/client-key.pem");
|
||||
sprintf(client_cert, "./ssl-cert/client-cert.pem");
|
||||
sprintf(ca, "./ssl-cert/ca.pem");
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf(client_key, "%s/ssl-cert/client-key.pem", test_dir);
|
||||
sprintf(client_cert, "%s/ssl-cert/client-cert.pem", test_dir);
|
||||
sprintf(ca, "%s/ssl-cert/ca.pem", test_dir);
|
||||
}
|
||||
sprintf(client_key, "%s/ssl-cert/client-key.pem", test_dir);
|
||||
sprintf(client_cert, "%s/ssl-cert/client-cert.pem", test_dir);
|
||||
sprintf(ca, "%s/ssl-cert/ca.pem", test_dir);
|
||||
|
||||
return mysql_ssl_set(conn, client_key, client_cert, ca, NULL, NULL);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user