[Libwebsockets] working with wolfssl

Andy Green andy at warmcat.com
Wed May 12 09:25:59 CEST 2021



On 5/10/21 11:01 PM, andy at warmcat.com wrote:
> 
> 
> On May 10, 2021 7:46:38 PM UTC, Trey Weaver <treyweaver at fastmail.net> wrote:
>> Andy, your email helped!
>>
>> For some reason the wolfssl was not building with the openssl api even
>> though I had the --enable-opensslextra option on.  So I got past that
>> issue.
> 
> I think you solved that.
> 
>> I am compiling on the Arm (iMX6 -- Solid Run Module) both the WolfSSL
>> and libwebsockets.  Here are the cmake and configure for both.
>>
>> WolfSSL
>> ./configure --enable-opensslextra --enable-static –-enable-debug
>> --enable-examples --enable-harden --host=arm-linux-gnueabihf
>> --enable-hc128
> 
> A couple of years ago we had an FAE from wolfssl discuss supporting it in lws with us, on behalf of his paying customers that wanted to use it in lws, and then provided a patch on lws which I gratefully took.  Later I added the CI build against wolfssl to make sure it didn't regress, we now build against openssl3, boringssl and libressl in CI too.
> 
> For whatever reason, I guess from his perspective it was easier for this to meddle with wolfssl than adapt lws bits, part of the adaptation was he added a --enable-libwebsockets config flag on wolfssl that you also need.

 > I tried the --enable-libwebsockets flag and it did not solve the problem.

I think you should try it a bit harder, wolfSSL_get_ex_new_index() 
exists in wolfssl

https://github.com/wolfSSL/wolfssl/blob/master/wolfssl/ssl.h#L1093

...but it is dependent on building wolfssl with HAVE_EX_DATA 
configuration.  When you choose --enable-libwebsockets on wolfssl, it 
sets that

https://github.com/wolfSSL/wolfssl/blob/master/configure.ac#L851

so I think you need to nuke your wolfssl build artifacts, rebuild with 
--enable-libwebsockets, and do the make install if you did it before.

-Andy


More information about the Libwebsockets mailing list