[Libwebsockets] working with wolfssl
andy at warmcat.com
Mon May 10 15:41:29 CEST 2021
On 5/10/21 2:25 PM, Trey Weaver wrote:
> When I do a straight up:
> *cmake ..*
> everything goes fine. But when I try to add the wolfssl stuff like this:
> cmake -DLWS_WITH_WOLFSSL=1
> just like the build notes say to do and then do a make then I get this
> *jps at dsp:~/Development/libwebsockets-4.2/libwebsockets/build$ make*
> *Scanning dependencies of target GENHDR*
> *[ 0%] Creating build include dir*
> *[ 0%] Built target GENHDR*
> *Scanning dependencies of target websockets_shared*
> *[ 1%] Building C object
> *In file included from
> * from
> * from
> error: unknown type name ‘HMAC_CTX’*
> * HMAC_CTX ctx;*
> * ^~~~~~~~*
> *make: *** [lib/CMakeFiles/websockets_shared.dir/build.make:63:
> lib/CMakeFiles/websockets_shared.dir/plat/unix/unix-caps.c.o] Error 1*
> *make: *** [CMakeFiles/Makefile2:1076:
> lib/CMakeFiles/websockets_shared.dir/all] Error 2*
> *make: *** [Makefile:163: all] Error 2*
> I am building 4.2 on a 32 bit ARM (iMX6).
So it's a native build actually on the arm device?
> I do see this in CMAKE:
> *-- Looking for wolfSSL_HMAC_CTX_new
> *-- Looking for wolfSSL_HMAC_CTX_new - not found
> I did compile wolfssl with the --enable-opensslextra option.
> I have attached the cmake output file....I don't know why every wolfssl
> option is "not found" or if that is normal.
Most of them are "not found" on the CI build, eg
... but there are like 5 or so that are found when built on x86_64 in
-- Looking for wolfSSL_HMAC_CTX_new
-- Looking for wolfSSL_HMAC_CTX_new - found
It should have emitted something like this on stdout (I think)
Compiling with SSL support
wolfSSL include dir: /usr/local/include
wolfSSL libraries: /usr/local/lib/libwolfssl.so
I would look into exactly what you have in
it should contain a subdir wolfssl/ that has a bunch of .h, an openssl
subdir inside wolfssl/ etc.
If that looks OK, then you need to go look in whatever your equivalent
of ./build/CMakeFiles/CMakeError.log is, and find the test it did for
wolfSSL_HMAC_CTX_new(), and paste what happened with that test. The
test builds that CMake does to determine api existence are allowed to
fail, then it takes the failure to mean that the api it was looking for
doesn't exist. But there are many reasons the tests can fail to build,
eg, missing library so it can't link.
Also in CI, it is dynamically linking to the .so version of Wolfssl, you
might try that.
More information about the Libwebsockets