Keep 'sslv23' for compability, but deprected. (it will be removed in the next version)

This commit is contained in:
Bruno Silvestre 2015-11-19 12:33:06 -02:00
parent 8be458ff8a
commit 6a7a6f7f67

View File

@ -35,6 +35,9 @@ typedef const SSL_METHOD LSEC_SSL_METHOD;
typedef SSL_METHOD LSEC_SSL_METHOD; typedef SSL_METHOD LSEC_SSL_METHOD;
#endif #endif
#if OPENSSL_VERSION_NUMBER>=0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
#define SSLv23_method() TLS_method()
#endif
/*-- Compat - Lua 5.1 --------------------------------------------------------*/ /*-- Compat - Lua 5.1 --------------------------------------------------------*/
@ -93,10 +96,8 @@ static int set_option_flag(const char *opt, unsigned long *flag)
*/ */
static LSEC_SSL_METHOD* str2method(const char *method) static LSEC_SSL_METHOD* str2method(const char *method)
{ {
#if OPENSSL_VERSION_NUMBER>=0x10100000L && !defined(LIBRESSL_VERSION_NUMBER) if (!strcmp(method, "any")) return SSLv23_method();
#define SSLv23_method TLS_method if (!strcmp(method, "sslv23")) return SSLv23_method(); // deprecated
#endif
if (!strcmp(method, "any")) return SSLv23_method();
#ifndef OPENSSL_NO_SSL3 #ifndef OPENSSL_NO_SSL3
if (!strcmp(method, "sslv3")) return SSLv3_method(); if (!strcmp(method, "sslv3")) return SSLv3_method();
#endif #endif