sslopt-case.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
  2. This program is free software; you can redistribute it and/or modify
  3. it under the terms of the GNU General Public License, version 2.0,
  4. as published by the Free Software Foundation.
  5. This program is also distributed with certain software (including
  6. but not limited to OpenSSL) that is licensed under separate terms,
  7. as designated in a particular file or component or in included license
  8. documentation. The authors of MySQL hereby grant you an additional
  9. permission to link the program and your derivative works with the
  10. separately licensed software that they have included with MySQL.
  11. This program is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. GNU General Public License, version 2.0, for more details.
  15. You should have received a copy of the GNU General Public License
  16. along with this program; if not, write to the Free Software
  17. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
  18. #if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
  19. #ifndef MYSQL_CLIENT
  20. #error This header is supposed to be used only in the client
  21. #endif
  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. break;
  58. #endif /* HAVE_OPENSSL */