summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRamil Kalimullin <ramil.kalimullin@oracle.com>2016-02-19 23:31:10 +0400
committerRamil Kalimullin <ramil.kalimullin@oracle.com>2016-02-19 23:31:10 +0400
commitb3e9211e48a3fb586e88b0270a175d2348935424 (patch)
tree6289051e87d89f272a9392d749ce580a83eb2743 /include
parentd9c541cb1be5b239787833d9d499067d44ea44d3 (diff)
downloadmariadb-git-b3e9211e48a3fb586e88b0270a175d2348935424.tar.gz
WL#9072: Backport WL#8785 to 5.5
Diffstat (limited to 'include')
-rw-r--r--include/sslopt-case.h15
-rw-r--r--include/sslopt-longopts.h5
-rw-r--r--include/sslopt-vars.h12
3 files changed, 27 insertions, 5 deletions
diff --git a/include/sslopt-case.h b/include/sslopt-case.h
index 2da5ff317e1..57702b3b352 100644
--- a/include/sslopt-case.h
+++ b/include/sslopt-case.h
@@ -1,7 +1,7 @@
#ifndef SSLOPT_CASE_INCLUDED
#define SSLOPT_CASE_INCLUDED
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -28,5 +28,18 @@
*/
opt_use_ssl= 1;
break;
+#ifdef MYSQL_CLIENT
+ case OPT_SSL_MODE:
+ if (my_strcasecmp(&my_charset_latin1, argument, "required"))
+ {
+ fprintf(stderr,
+ "Unknown value to --ssl-mode: '%s'. Use --ssl-mode=REQUIRED\n",
+ argument);
+ exit(1);
+ }
+ else
+ opt_ssl_required= 1;
+ break;
+#endif /* MYSQL_CLIENT */
#endif
#endif /* SSLOPT_CASE_INCLUDED */
diff --git a/include/sslopt-longopts.h b/include/sslopt-longopts.h
index db99d1dfa26..fd42e83eb04 100644
--- a/include/sslopt-longopts.h
+++ b/include/sslopt-longopts.h
@@ -1,7 +1,7 @@
#ifndef SSLOPT_LONGOPTS_INCLUDED
#define SSLOPT_LONGOPTS_INCLUDED
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -44,6 +44,9 @@
"when connecting. This option is disabled by default.",
&opt_ssl_verify_server_cert, &opt_ssl_verify_server_cert,
0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},
+ {"ssl-mode", OPT_SSL_MODE,
+ "SSL connection mode.",
+ 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
#endif /* HAVE_OPENSSL */
#endif /* SSLOPT_LONGOPTS_INCLUDED */
diff --git a/include/sslopt-vars.h b/include/sslopt-vars.h
index 01093feceaf..6c9bd4296ef 100644
--- a/include/sslopt-vars.h
+++ b/include/sslopt-vars.h
@@ -1,7 +1,7 @@
#ifndef SSLOPT_VARS_INCLUDED
#define SSLOPT_VARS_INCLUDED
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -28,8 +28,14 @@ SSL_STATIC char *opt_ssl_capath = 0;
SSL_STATIC char *opt_ssl_cert = 0;
SSL_STATIC char *opt_ssl_cipher = 0;
SSL_STATIC char *opt_ssl_key = 0;
+
#ifdef MYSQL_CLIENT
SSL_STATIC my_bool opt_ssl_verify_server_cert= 0;
-#endif
-#endif
+SSL_STATIC my_bool opt_ssl_required= 0;
+#endif /* MYSQL_CLIENT */
+
+#else /* HAVE_OPENSSL */
+#define opt_ssl_required 0
+#endif /* HAVE_OPENSSL */
+
#endif /* SSLOPT_VARS_INCLUDED */