OSDN Git Service

First version
[st-ro/stro.git] / 3rdparty / mysql / include / sslopt-case.h
1 /* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
2
3    This program is free software; you can redistribute it and/or modify
4    it under the terms of the GNU General Public License as published by
5    the Free Software Foundation; version 2 of the License.
6
7    This program is distributed in the hope that it will be useful,
8    but WITHOUT ANY WARRANTY; without even the implied warranty of
9    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10    GNU General Public License for more details.
11
12    You should have received a copy of the GNU General Public License
13    along with this program; if not, write to the Free Software
14    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA */
15
16 #if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
17
18 #ifndef MYSQL_CLIENT
19 #error This header is supposed to be used only in the client
20 #endif
21
22     case OPT_SSL_MODE:
23       opt_ssl_mode= find_type_or_exit(argument, &ssl_mode_typelib,
24                                       opt->name);
25       ssl_mode_set_explicitly= TRUE;
26       break;
27     case OPT_SSL_SSL:
28       CLIENT_WARN_DEPRECATED("--ssl", "--ssl-mode");
29       if (!opt_use_ssl_arg)
30         opt_ssl_mode= SSL_MODE_DISABLED;
31       else if (opt_ssl_mode < SSL_MODE_REQUIRED)
32         opt_ssl_mode= SSL_MODE_REQUIRED;
33       break;
34     case OPT_SSL_VERIFY_SERVER_CERT:
35       CLIENT_WARN_DEPRECATED("--ssl-verify-server-cert",
36                              "--ssl-mode=VERIFY_IDENTITY");
37       if (!opt_ssl_verify_server_cert_arg)
38       {
39         if (opt_ssl_mode >= SSL_MODE_VERIFY_IDENTITY)
40           opt_ssl_mode= SSL_MODE_VERIFY_CA;
41       }
42       else
43         opt_ssl_mode= SSL_MODE_VERIFY_IDENTITY;
44       break;
45     case OPT_SSL_CA:
46     case OPT_SSL_CAPATH:
47       /* Don't change ssl-mode if set explicitly. */ 
48       if (!ssl_mode_set_explicitly)
49         opt_ssl_mode= SSL_MODE_VERIFY_CA;
50       break;
51     case OPT_SSL_KEY:
52     case OPT_SSL_CERT:
53     case OPT_SSL_CIPHER:
54     case OPT_SSL_CRL:
55     case OPT_SSL_CRLPATH:
56     case OPT_TLS_VERSION:
57 #ifdef HAVE_YASSL
58       /* crl has no effect in yaSSL. */
59       opt_ssl_crl= NULL;
60       opt_ssl_crlpath= NULL;
61 #endif /* HAVE_YASSL */
62       break;
63 #endif /* HAVE_OPENSSL */