NOEXPORT char *tls_methods_set(SERVICE_OPTIONS *section, const char *arg) {
    if(!arg) { /* defaults */
        section->client_method=(SSL_METHOD *)SSLv23_client_method();
        section->server_method=(SSL_METHOD *)SSLv23_server_method();
    } else if(!strcasecmp(arg, "all")) {
        section->client_method=(SSL_METHOD *)SSLv23_client_method();
        section->server_method=(SSL_METHOD *)SSLv23_server_method();
    } else if(!strcasecmp(arg, "SSLv2")) {
#ifndef OPENSSL_NO_SSL2
        section->client_method=(SSL_METHOD *)SSLv2_client_method();
        section->server_method=(SSL_METHOD *)SSLv2_server_method();
#else /* OPENSSL_NO_SSL2 */
        return "SSLv2 not supported";
#endif /* !OPENSSL_NO_SSL2 */
    } else if(!strcasecmp(arg, "SSLv3")) {
#ifndef OPENSSL_NO_SSL3
        section->client_method=(SSL_METHOD *)SSLv3_client_method();
        section->server_method=(SSL_METHOD *)SSLv3_server_method();
#else /* OPENSSL_NO_SSL3 */
        return "SSLv3 not supported";
#endif /* !OPENSSL_NO_SSL3 */
    } else if(!strcasecmp(arg, "TLSv1")) {
#ifndef OPENSSL_NO_TLS1
        section->client_method=(SSL_METHOD *)TLSv1_client_method();
        section->server_method=(SSL_METHOD *)TLSv1_server_method();
#else /* OPENSSL_NO_TLS1 */
        return "TLSv1 not supported";
#endif /* !OPENSSL_NO_TLS1 */
    } else if(!strcasecmp(arg, "TLSv1.1")) {
#ifndef OPENSSL_NO_TLS1_1
        section->client_method=(SSL_METHOD *)TLSv1_1_client_method();
        section->server_method=(SSL_METHOD *)TLSv1_1_server_method();
#else /* OPENSSL_NO_TLS1_1 */
        return "TLSv1.1 not supported";
#endif /* !OPENSSL_NO_TLS1_1 */
    } else if(!strcasecmp(arg, "TLSv1.2")) {
#ifndef OPENSSL_NO_TLS1_2
        section->client_method=(SSL_METHOD *)TLSv1_2_client_method();
        section->server_method=(SSL_METHOD *)TLSv1_2_server_method();
#else /* OPENSSL_NO_TLS1_2 */
        return "TLSv1.2 not supported";
#endif /* !OPENSSL_NO_TLS1_2 */
    } else
        return "Incorrect version of TLS protocol";
    return NULL; /* OK */
}
NOEXPORT char *tls_methods_set(SERVICE_OPTIONS *section, const char *arg) {
    if(!arg) {  
        section->client_method=(SSL_METHOD *)SSLv23_client_method();
        section->server_method=(SSL_METHOD *)SSLv23_server_method();
    } else if(!strcasecmp(arg, "all")) {
        section->client_method=(SSL_METHOD *)SSLv23_client_method();
        section->server_method=(SSL_METHOD *)SSLv23_server_method();
    } else if(!strcasecmp(arg, "SSLv2")) {
#ifndef OPENSSL_NO_SSL2
        section->client_method=(SSL_METHOD *)SSLv2_client_method();
        section->server_method=(SSL_METHOD *)SSLv2_server_method();
#else  
        return "SSLv2 not supported";
#endif  
    } else if(!strcasecmp(arg, "SSLv3")) {
#ifndef OPENSSL_NO_SSL3
        section->client_method=(SSL_METHOD *)SSLv3_client_method();
        section->server_method=(SSL_METHOD *)SSLv3_server_method();
#else  
        return "SSLv3 not supported";
#endif  
    } else if(!strcasecmp(arg, "TLSv1")) {
#ifndef OPENSSL_NO_TLS1
        section->client_method=(SSL_METHOD *)TLSv1_client_method();
        section->server_method=(SSL_METHOD *)TLSv1_server_method();
#else  
        return "TLSv1 not supported";
#endif  
    } else if(!strcasecmp(arg, "TLSv1.1")) {
#ifndef OPENSSL_NO_TLS1_1
        section->client_method=(SSL_METHOD *)TLSv1_1_client_method();
        section->server_method=(SSL_METHOD *)TLSv1_1_server_method();
#else  
        return "TLSv1.1 not supported";
#endif  
    } else if(!strcasecmp(arg, "TLSv1.2")) {
#ifndef OPENSSL_NO_TLS1_2
        section->client_method=(SSL_METHOD *)TLSv1_2_client_method();
        section->server_method=(SSL_METHOD *)TLSv1_2_server_method();
#else  
        return "TLSv1.2 not supported";
#endif  
    } else
        return "Incorrect version of TLS protocol";
    return NULL;  
}