@cryptotaxi247 / netdata-1 / commits / 1ac12904b

fix compilation for older systems (#9198)

inherit libs for clock_gettime() when building libmosquitto; Check that X509_VERIFY_PARAM_set1_host is available on the target system

Costa Tsaousis committed May 30, 2020 at 00:13 UTC 1ac12904b0697f1a3131af2f9ed3addc6b396ad9
3 files changed +23 -1
aclk/aclk_lws_https_client.c
+4
@@ -193,6 +193,10 @@ int aclk_send_https_request(char *method, char *host, char *port, char *url, cha
193 #else
194 i.ssl_connection = LCCSCF_USE_SSL;
195 #endif
196 +#if defined(HAVE_X509_VERIFY_PARAM_set1_host) && HAVE_X509_VERIFY_PARAM_set1_host == 0
197 +#warning DISABLING SSL HOSTNAME VALIDATION BECAUSE IT IS NOT AVAILABLE ON THIS SYSTEM.
198 + i.ssl_connection |= LCCSCF_SKIP_SERVER_CERT_HOSTNAME_CHECK;
199 +#endif
200
201 i.port = atoi(port);
202 i.address = host;
aclk/aclk_lws_wss_client.c
+4
@@ -321,6 +321,10 @@ int aclk_lws_wss_connect(char *host, int port)
321 info("Disabling SSL certificate checks");
322 #else
323 i.ssl_connection = LCCSCF_USE_SSL;
324 +#endif
325 +#if defined(HAVE_X509_VERIFY_PARAM_set1_host) && HAVE_X509_VERIFY_PARAM_set1_host == 0
326 +#warning DISABLING SSL HOSTNAME VALIDATION BECAUSE IT IS NOT AVAILABLE ON THIS SYSTEM.
327 + i.ssl_connection |= LCCSCF_SKIP_SERVER_CERT_HOSTNAME_CHECK;
328 #endif
329 lws_client_connect_via_info(&i);
330 return 0;
configure.ac
+15 -1
@@ -371,6 +371,20 @@ AC_CHECK_LIB(
371 [SSL_LIBS="-lcrypto -lssl"]
372 )
373
374 +AC_CHECK_LIB(
375 + [crypto],
376 + [X509_VERIFY_PARAM_set1_host],
377 + [ssl_host_validation="yes"],
378 + [ssl_host_validation="no"]
379 +)
380 +
381 +if test "${ssl_host_validation}" = "no"; then
382 + AC_DEFINE([HAVE_X509_VERIFY_PARAM_set1_host], [0], [ssl host validation])
383 + AC_MSG_WARN([DISABLING SSL HOSTNAME VALIDATION BECAUSE IT IS NOT AVAILABLE ON THIS SYSTEM.])
384 +else
385 + AC_DEFINE([HAVE_X509_VERIFY_PARAM_set1_host], [1], [ssl host validation])
386 +fi
387 +
388 # -----------------------------------------------------------------------------
389 # JSON-C library
390
@@ -586,7 +600,7 @@ if test "$enable_cloud" != "no"; then
600 AC_MSG_CHECKING([if libmosquitto static lib is present (and builds)])
601 if test -f "externaldeps/mosquitto/libmosquitto.a"; then
602 LIBS_BKP="${LIBS}"
589 - LIBS="externaldeps/mosquitto/libmosquitto.a ${OPTIONAL_SSL_LIBS}"
603 + LIBS="externaldeps/mosquitto/libmosquitto.a ${OPTIONAL_SSL_LIBS} ${LIBS_BKP}"
604 AC_LINK_IFELSE([AC_LANG_SOURCE([[#include "externaldeps/mosquitto/mosquitto.h"
605 int main (int argc, char **argv) {
606 int m,mm,r;