-
Notifications
You must be signed in to change notification settings - Fork 440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Paho sync client ssl return "Error: MQTT error [-13]: SSL is not supported [0]" #506
Comments
That error bubbles up from the Paho C library. It means the version of the C library that you linked to was built without OpenSSL support. Both the Paho C and C++ libraries must be compiled with SSL support. By default the C library is not built with SSL support. It must be turned on via a CMake build option. Unfortunately, I don't use Windows much, and I've never used vpkg. I have no idea who even created the vpkg support for this library (but I much appreciate it!). Make sure you have the correct Paho C lib installed and that you're linking to the one that you think you're linking to... |
I tried to build the c++ like you advised under "Build the Paho C++ and Paho C libraries together" with little difference in for cmake i used mine. i could build it and had my 5 static libraries under paho\lib. I linked paho-mqttpp3-static.lib to my Project in VStudio. But got tons of unresolved external symbol errors. When checking the symbols with dumpbin they are visible. I also checked the machine and it's compiled for x64. I also tried to download both repos separately and compiling them, but same issue. Do i miss any thing... |
With static library linkage, |
Ok, i included all five libs now and also ws2_32.lib but still unresolved external symbols. Pretty much all of them are paho-mqtt3as-static.lib(SSLSocket.obj). |
Uninformed guessing, litte details... Don't expect much progress. |
I have placed libeay32.lib and ssleay32.lib from the openssl64 folder. |
I don't know where you openssl64 libs comes from. Does it matches the includes and how you used them? |
I'm not using vcpkg for now. I was building the libraries from the github repositories. And the openssl library, i downloaded it from here "https://code.google.com/archive/p/openssl-for-windows/downloads". Had no error just compiled gave me 5 libs all marked as static. linked them to my project, which is an example paho-mqtt-cpp provided, and got those errors. |
openssl 0.9.8, seriously? Then I also don't need to speak about import libs and dllimport. |
Yeah, that's a horribly outdated OpenSSL. For Windows, I've been using the latest binaries from here: Currently that's v3.3.1 |
Thanks for the hint. I changed the Openssl to the one i have in my vcpkg includes and it worked. inside paho.mqtt.c C:\Users\Manfr\source\repos\Manfred-O\paho\paho.mqtt.c>cmake -Bbuild -H. -DPAHO_WITH_SSL=TRUE -DOPENSSL_ROOT_DIR=C:\Users\Manfr\vcpkg\installed\x64-windows-static -DPAHO_BUILD_STATIC=TRUE -DPAHO_BUILD_SHARED=FALSE -DPAHO_ENABLE_TESTING=FALSE -DCMAKE_INSTALL_PREFIX=C:\Users\Manfr\source\repos\Manfred-O\paho\static Update the VERSION argument value or use a ... suffix to tell -- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.22635. then C:\Users\Manfr\source\repos\Manfred-O\paho\paho.mqtt.c>cmake --build build/ --target install warnings and for paho.mqtt.cpp C:\Users\Manfr\source\repos\Manfred-O\paho\paho.mqtt.cpp>cmake -Bbuild -H. -DPAHO_WITH_SSL=TRUE -DOPENSSL_ROOT_DIR=C:\Users\Manfr\vcpkg\installed\x64-windows-static -DPAHO_BUILD_STATIC=TRUE -DPAHO_BUILD_SHARED=FALSE -DPAHO_ENABLE_TESTING=FALSE -DCMAKE_PREFIX_PATH=C:\Users\Manfr\source\repos\Manfred-O\paho\static -DCMAKE_INSTALL_PREFIX=C:\Users\Manfr\source\repos\Manfred-O\paho\static
-- Build files have been written to: C:/Users/Manfr/source/repos/Manfred-O/paho/paho.mqtt.cpp/build after that no warnings Visualstudio gave me that errors Severity Code Description Project File Line Suppression State Details So i just comment the SHA1.c file from the build process inside the CMakeList.txt and build again. Now when using your example for a ssl publishing it works for both asyn client and for sync client. Now the next challenge is to automate it via vcpkg manager. Thanks for help |
The build warnings for the SHA1 functions are expected. That should be fixed in the Paho C v1.4 release. But it should still link. I don't know where the linker errors are coming from. |
Hi, i'm trying to setup a secure connection to my broker by using the paho sync client library.
But unfortunately i'm getting the error ssl not supported. But i have compiled them, so i'm wondering how it comes to get that error.
I'm using the vcpkg manager and when listing my packages those are my results.
paho-mqtt:x64-windows-static 1.3.13#1 Paho project provides open-source client impleme...
paho-mqttpp3:x64-windows-static 1.4.1 Paho project provides open-source C++ wrapper fo...
paho-mqttpp3[ssl]:x64-windows-static Build with SSL support
When using your "examples/ssl_publish.cpp" together with the async dlls it work.
paho-mqttpp3[ssl]:x64-windows Build with SSL support
But i like to use the static one with sync client. Do i miss something.
Thanks in advance
The text was updated successfully, but these errors were encountered: