wolfssl: adjust to new API in v4.2.0
authorEneas U de Queiroz <cotequeiroz@gmail.com>
Tue, 29 Oct 2019 21:24:16 +0000 (18:24 -0300)
committerHauke Mehrtens <hauke@hauke-m.de>
Fri, 1 Nov 2019 17:42:18 +0000 (18:42 +0100)
WolfSSL has recently added many openssl 1.1+ calls, including
TLS_server_method & TLS_client_method, which were being redefined,
causing compilation failure:
ustream-openssl.c:113:0: error: "TLS_server_method" redefined [-Werror]
ustream-openssl.c:114:0: error: "TLS_client_method" redefined [-Werror]

Only define the symbols if not previously defined.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
ustream-openssl.c

index c8306184d2dff71a99aaa85ed46577c123158890..14694733fb2dcf4c89b2052fabd651a9cf8d8cec 100644 (file)
@@ -110,8 +110,12 @@ __ustream_ssl_context_new(bool server)
                SSL_library_init();
                _init = true;
        }
-# define TLS_server_method SSLv23_server_method
-# define TLS_client_method SSLv23_client_method
+# ifndef TLS_server_method
+#  define TLS_server_method SSLv23_server_method
+# endif
+# ifndef TLS_client_method
+#  define TLS_client_method SSLv23_client_method
+# endif
 #endif
 
        if (server) {