wifidog: make it compile again with recent version of WolfSSL
[feed/packages.git] / net / wifidog / patches / 011-use-tls-above-1.patch
1 --- a/configure.in
2 +++ b/configure.in
3 @@ -94,7 +94,7 @@ if test "x$enable_wolfssl" = xyes; then
4 [
5 #include <wolfssl/options.h>
6 ])
7 - AC_SEARCH_LIBS([wolfTLSv1_client_method], [wolfssl], [], [
8 + AC_SEARCH_LIBS([wolfSSLv23_client_method], [wolfssl], [], [
9 AC_MSG_ERROR([unable to locate SSL lib: wolfSSL needed.])
10 ])
11
12 @@ -107,7 +107,7 @@ if test "x$enable_wolfssl" = xyes; then
13 ]], [[
14 WOLFSSL_CTX *ctx;
15 wolfSSL_Init();
16 - ctx = wolfSSL_CTX_new(wolfTLSv1_client_method());
17 + ctx = wolfSSL_CTX_new(wolfSSLv23_client_method());
18 wolfSSL_CTX_UseSNI(ctx, WOLFSSL_SNI_HOST_NAME, "wifidog.org", 11);
19 ]])], [enabled_sni=yes], [enabled_sni=no])
20
21 --- a/src/simple_http.c
22 +++ b/src/simple_http.c
23 @@ -160,8 +160,7 @@ get_wolfssl_ctx(const char *hostname)
24 if (NULL == wolfssl_ctx) {
25 wolfSSL_Init();
26 /* Create the WOLFSSL_CTX */
27 - /* Allow TLSv1.0 up to TLSv1.2 */
28 - if ((wolfssl_ctx = wolfSSL_CTX_new(wolfTLSv1_client_method())) == NULL) {
29 + if ((wolfssl_ctx = wolfSSL_CTX_new(wolfSSLv23_client_method())) == NULL) {
30 debug(LOG_ERR, "Could not create WOLFSSL context.");
31 UNLOCK_WOLFSSL_CTX();
32 return NULL;