eclipse / mosquitto

Eclipse Mosquitto - An open source MQTT broker
https://mosquitto.org
Other
8.93k stars 2.37k forks source link

Cannot use custom plugins that utilize openssl with mosquitto docker 2.0.15 #2801

Open barrowsrobbBnS opened 1 year ago

barrowsrobbBnS commented 1 year ago

I am using the moquitto:2.0.15 docker

I have a plugin that I have created plugin.so that uses libcrypto.so.1.1 and libssl.so.1.1 as those are the libraries in the docker and provided by apk add openssl-dev

However when the mosquitto uses dlopen and tries to run things in my plugin it will instead resolve the openssl symbols using the so's loaded by mosquitto. Namely /usr/lib/libssl.so.52.0.0 /usr/lib/libcrypto.so.49.0.0 /usr/lib/libssl.so.52 /usr/lib/libcrypto.so.49

I would gladly link against these in my plugin but I do not have appropriate headers for them and I cannot seem to find where the docker build gets these files from.

As a interim solution I am required to build mosquitto from source (in the mosquitto docker) to get it to use openssl 1.1.1. After doing this the libraries match and function properly.

How can I build against the same libs that mosquitto was build against (libssl.so.52.0.0 and /usr/lib/libcrypto.so.49.0.0). Where did they come from?

Here is my top level CMake that pulls in my OpenSSL using so file and creates the plugin.so CMakeLists.txt

And here is subdirectory CMake I use for my driver "so" file that uses OpenSSL: CMakeLists.txt

manthanrtilva commented 1 year ago

You should look at https://github.com/eclipse/mosquitto/tree/master/docker, there are docker files which are build and then pushed to docker hub.