summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorAlexey Botchkov <holyfoot@askmonty.org>2016-04-26 14:37:19 +0400
committerAlexey Botchkov <holyfoot@askmonty.org>2016-04-26 14:37:19 +0400
commit44554d611194e2ac02e5beaf4b88ffe5a349ebb4 (patch)
treedcd4f5a5d5521d03d8fb2904dde97c9d57ada075 /client
parent0dbc66498d9222d91b73d4c0a8a40c96bd3dc296 (diff)
downloadmariadb-git-44554d611194e2ac02e5beaf4b88ffe5a349ebb4.tar.gz
MDEV-9605 mysqlbinlog does not accept ssl-ca option as expected.
Added SSL support to the mysqlbinlog.
Diffstat (limited to 'client')
-rw-r--r--client/mysqlbinlog.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc
index 315fdcd22dc..4be31421f9b 100644
--- a/client/mysqlbinlog.cc
+++ b/client/mysqlbinlog.cc
@@ -34,6 +34,7 @@
#define TABLE TABLE_CLIENT
#include "client_priv.h"
#include <my_time.h>
+#include <sslopt-vars.h>
/* That one is necessary for defines of OPTION_NO_FOREIGN_KEY_CHECKS etc */
#include "sql_priv.h"
#include "log_event.h"
@@ -1392,6 +1393,7 @@ static struct my_option my_options[] =
{"socket", 'S', "The socket file to use for connection.",
&sock, &sock, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0,
0, 0},
+#include <sslopt-longopts.h>
{"start-datetime", OPT_START_DATETIME,
"Start reading the binlog at first event having a datetime equal or "
"posterior to the argument; the argument must be a date and time "
@@ -1599,6 +1601,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
DBUG_PUSH(argument ? argument : default_dbug_option);
break;
#endif
+#include <sslopt-case.h>
case 'd':
one_database = 1;
break;
@@ -1748,6 +1751,18 @@ static Exit_status safe_connect()
return ERROR_STOP;
}
+#ifdef HAVE_OPENSSL
+ if (opt_use_ssl)
+ {
+ mysql_ssl_set(mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
+ opt_ssl_capath, opt_ssl_cipher);
+ mysql_options(mysql, MYSQL_OPT_SSL_CRL, opt_ssl_crl);
+ mysql_options(mysql, MYSQL_OPT_SSL_CRLPATH, opt_ssl_crlpath);
+ }
+ mysql_options(mysql,MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
+ (char*)&opt_ssl_verify_server_cert);
+#endif /*HAVE_OPENSSL*/
+
if (opt_plugindir && *opt_plugindir)
mysql_options(mysql, MYSQL_PLUGIN_DIR, opt_plugindir);