MySQL++ SSL Support on Linux
I am attempting to get MySQL++ to work correctly on Debian 6 with SSL support. I have tested everything on Windows 7 and it works great. Everything is encrypted. I am having a little bit of trouble porting it to Debian though.
This is my error:
terminate called after throwing an instance of 'mysqlpp::BadOption'
what(): Option not supported by database driver v5.1.49
This is my call for setting the certificate files:
connection->set开发者_开发百科_option(new mysqlpp::SslOption("/root/certs/client-key.pem", "/root/certs/client-cert.pem", "/root/certs/ca-cert.pem", "/root/certs", "DHE-RSA-AES256-SHA"));
I have noticed that when configuring MySQL++ it looks for mysql_ssl_set() in libmysqlclient. It does not find that function.
checking for mysql_ssl_set in -l... no
This bug is fixed in MySQL++ 3.2.0, released today.
In older versions, there's a bug in the test for mysql_ssl_set()
. If you cannot use the current version but can patch your version's source code, this will fix it:
Index: config/mysql_ssl.m4
===================================================================
--- config/mysql_ssl.m4 (revision 2696)
+++ config/mysql_ssl.m4 (working copy)
@@ -10,7 +10,7 @@
#
# Check for mysql_ssl_set() in libmysqlclient(_r)
#
- AC_CHECK_LIB($MYSQL_C_LIB, mysql_ssl_set, [
+ AC_CHECK_LIB($MYSQL_C_LIB_NAME, mysql_ssl_set, [
AC_DEFINE(HAVE_MYSQL_SSL_SET,, Define if your MySQL library has SSL functions)
]) dnl AC_CHECK_LIB(mysqlclient, mysql_ssl_set)
]) dnl MYSQL_WITH_SSL
You will then need to re-bootstrap the source tree, and rebuild.
精彩评论