Clone of PhatAC @ https://github.com/floaterxk/PhatAC

sslopt-case.h 2.2KB

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