diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 57cc9781..ccf6895a 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -18,7 +18,7 @@ jobs: uses: actions/checkout@v2 - name: packages - run: sudo apt-get update && sudo apt-get install -y libmosquitto1 libmosquitto-dev + run: sudo apt-get update && sudo apt-get install -y libmosquitto1 libmosquitto-dev libssl1.1 libssl-dev - name: build run: cmake -Dcoverage=1 -DBUILD_TESTING=1 . && make diff --git a/README.md b/README.md index c2b3b31d..43d968e5 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,7 @@ Building ebusd from the source requires the following packages and/or features: * kernel with pselect or ppoll support * glibc with argp support or argp-standalone * libmosquitto-dev for MQTT support + * libssl-dev for SSL support To start the build process, run these commands: > ./autogen.sh diff --git a/configure.ac b/configure.ac index 976dee7b..d2547140 100755 --- a/configure.ac +++ b/configure.ac @@ -63,6 +63,18 @@ if test "x$with_mqtt" != "xno"; then fi AM_CONDITIONAL([MQTT], [test "x$with_mqtt" != "xno"]) +AC_ARG_WITH(ssl, AS_HELP_STRING([--without-ssl], [disable support for SSL]), [], [with_ssl=yes]) +if test "x$with_ssl" != "xno"; then + AC_CHECK_LIB([ssl], [OPENSSL_init_ssl], + [AC_CHECK_LIB([crypto], [CRYPTO_new_ex_data], + [AC_DEFINE_UNQUOTED(HAVE_SSL, [1], [Defined if SSL is enabled.])], + [AC_MSG_RESULT([Could not find CRYPTO_new_ex_data in libcrypto.]) + with_ssl="no"])], + [AC_MSG_RESULT([Could not find SSL_library_init in libssl.]) + with_ssl="no"]) +fi +AM_CONDITIONAL([SSL], [test "x$with_ssl" != "xno"]) + AC_MSG_CHECKING([for direct float format conversion]) AC_TRY_RUN( [ diff --git a/contrib/docker/Dockerfile b/contrib/docker/Dockerfile index 1f50d894..d330e635 100755 --- a/contrib/docker/Dockerfile +++ b/contrib/docker/Dockerfile @@ -3,7 +3,7 @@ ARG BASE_IMAGE FROM $BASE_IMAGE as build RUN apt-get update && apt-get install -y \ - libmosquitto-dev libstdc++6 libc6 libgcc1 \ + libmosquitto-dev libssl-dev libstdc++6 libc6 libgcc1 \ curl \ autoconf automake g++ make git \ && rm -rf /var/lib/apt/lists/* @@ -26,7 +26,7 @@ RUN ./make_debian.sh FROM $BASE_IMAGE-slim as image RUN apt-get update && apt-get install -y \ - libmosquitto1 libstdc++6 libc6 libgcc1 \ + libmosquitto1 libssl1.1 libstdc++6 libc6 libgcc1 \ && rm -rf /var/lib/apt/lists/* LABEL maintainer="ebusd@ebusd.eu" diff --git a/contrib/docker/Dockerfile.release b/contrib/docker/Dockerfile.release index 470802d9..4b30a81a 100644 --- a/contrib/docker/Dockerfile.release +++ b/contrib/docker/Dockerfile.release @@ -3,7 +3,7 @@ ARG BASE_IMAGE FROM $BASE_IMAGE as build RUN apt-get update && apt-get install -y \ - libmosquitto-dev libstdc++6 libc6 libgcc1 \ + libmosquitto-dev libssl-dev libstdc++6 libc6 libgcc1 \ curl \ autoconf automake g++ make git \ && rm -rf /var/lib/apt/lists/* @@ -26,7 +26,7 @@ RUN ./make_debian.sh FROM $BASE_IMAGE-slim as image RUN apt-get update && apt-get install -y \ - libmosquitto1 libstdc++6 libc6 libgcc1 \ + libmosquitto1 libssl1.1 libstdc++6 libc6 libgcc1 \ && rm -rf /var/lib/apt/lists/* LABEL maintainer="ebusd@ebusd.eu" diff --git a/contrib/docker/Dockerfile.template b/contrib/docker/Dockerfile.template index 94bb9bb8..3be96cf7 100644 --- a/contrib/docker/Dockerfile.template +++ b/contrib/docker/Dockerfile.template @@ -3,7 +3,7 @@ ARG BASE_IMAGE FROM $BASE_IMAGE as build RUN apt-get update && apt-get install -y \ - libmosquitto-dev libstdc++6 libc6 libgcc1 \ + libmosquitto-dev libssl-dev libstdc++6 libc6 libgcc1 \ curl \ autoconf automake g++ make git \ && rm -rf /var/lib/apt/lists/* @@ -26,7 +26,7 @@ RUN %EBUSD_MAKE% FROM $BASE_IMAGE-slim as image RUN apt-get update && apt-get install -y \ - libmosquitto1 libstdc++6 libc6 libgcc1 \ + libmosquitto1 libssl1.1 libstdc++6 libc6 libgcc1 \ && rm -rf /var/lib/apt/lists/* LABEL maintainer="ebusd@ebusd.eu" diff --git a/make_debian.sh b/make_debian.sh index 96bf9943..1d866536 100755 --- a/make_debian.sh +++ b/make_debian.sh @@ -80,6 +80,10 @@ else mqtt=1 fi fi +ldd $RELEASE/usr/bin/ebusd | egrep -q libssl.so.1.1 +if [ $? -eq 0 ]; then + extralibs="$extralibs, libssl1.1 (>= 1.1.1)" +fi if [ -n "$RUNTEST" ]; then echo diff --git a/src/ebusd/Makefile.am b/src/ebusd/Makefile.am index 9e19b7c9..0ecbf5a2 100644 --- a/src/ebusd/Makefile.am +++ b/src/ebusd/Makefile.am @@ -26,6 +26,10 @@ ebusd_LDADD = ../lib/utils/libutils.a \ -lpthread \ @EXTRA_LIBS@ +if SSL +ebusd_LDADD += -lssl -lcrypto +endif + if CONTRIB ebusd_LDADD += ../lib/ebus/contrib/libebuscontrib.a endif