27
27
int main(int argc, char **argv)
37
fprintf(stderr,"usage : ssl_test <dbname> <num>\n\n");
43
mysql_ssl_set(&mysql,"../SSL/MySQL-client-key.pem",
44
"../SSL/MySQL-client-cert.pem",
45
"../SSL/MySQL-ca-cert.pem", 0, 0);
47
if (!(sock = mysql_real_connect(&mysql,"127.0.0.1",0,0,argv[1],MYSQL_PORT,NULL,0)))
49
fprintf(stderr,"Couldn't connect to engine!\n%s\n\n",mysql_error(&mysql));
58
sprintf(qbuf,SELECT_QUERY,count);
59
if(mysql_query(sock,qbuf))
61
fprintf(stderr,"Query failed (%s)\n",mysql_error(sock));
64
if (!(res=mysql_store_result(sock)))
66
fprintf(stderr,"Couldn't get result from query failed (%s)\n",
71
printf("number of fields: %d\n",mysql_num_fields(res));
73
mysql_free_result(res);
77
#else /* HAVE_OPENSSL */
78
29
printf("ssl_test: SSL not configured.\n");
79
#endif /* HAVE_OPENSSL */
81
31
return 0; /* Keep some compilers happy */