From 7532f3b7290418509887e0938bd46eba62a96cad Mon Sep 17 00:00:00 2001 From: Paul Aurich Date: Wed, 12 Jun 2013 19:06:16 -0700 Subject: [PATCH] context: Support explicit selection of TLS v1.1 and v1.2 --- src/context.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/context.c b/src/context.c index 1fa30f5..80b90ee 100644 --- a/src/context.c +++ b/src/context.c @@ -62,9 +62,13 @@ static int set_option_flag(const char *opt, unsigned long *flag) */ static LSEC_SSL_METHOD* str2method(const char *method) { - if (!strcmp(method, "sslv3")) return SSLv3_method(); - if (!strcmp(method, "tlsv1")) return TLSv1_method(); - if (!strcmp(method, "sslv23")) return SSLv23_method(); + if (!strcmp(method, "sslv23")) return SSLv23_method(); + if (!strcmp(method, "sslv3")) return SSLv3_method(); + if (!strcmp(method, "tlsv1")) return TLSv1_method(); +#if (OPENSSL_VERSION_NUMBER >= 0x1000100fL) + if (!strcmp(method, "tlsv1_1")) return TLSv1_1_method(); + if (!strcmp(method, "tlsv1_2")) return TLSv1_2_method(); +#endif return NULL; }