[Libwebsockets] Errors when building 3rd Party programs with v1.5 of LWS on WIndows

Mark Hessling mark at rexx.org
Sun Nov 1 10:18:20 CET 2015


Hi Roger,

Thanks for the explanation.  I was simply reporting a change of
behaviour between versions 1.3 and 1.5 that broke my 3rd party program;
Rexx/WS that use LWS. 


On 01/11/15 18:09, Roger Light wrote:
> Hi Mark,
>
> The point of lws_config.h is to provide information about what options
> were configured when libwebsockets was compiled so you can detect
> server support etc. This can mean it ends up with not a lot of
> content.
I guess the point of lws_config.h has changed since the #ifdef
CMAKE_BUILD was removed from around #include "lws_config.h".
>
> It's certainly a bug that lws_config.h isn't included.
>
> The problem with the openssl header is that if libwebsockets is
> compiled with SSL support then any third party programs need to have
> knowledge of openssl data types - they are used in the
> lws_context_creation_info struct (the point there is to allow an
> already existing SSL_CTX to be used). It means you need to provide
> include paths for openssl when compiling your own application.
Rexx/WS can run as a server supporting https: and wss: without use of
the SSL_CTX pointer. It uses the certificate arguments passed in
lws_context_creation_info passed to libwebsocket_create_context(). Works
just fine, presumably has to use SSL support compiled into LWS, but does
not require Rexx/WS to know anything about SSL. Just the way a 3rd party
program likes to see support for features handled.

It sounds like you are suggesting that 3rd party programs like Rexx/WS
that want to use the existing abstraction of SSL support will now have
to deal with handling SSL support even though they never need to use SSL
directly just to stop a compilation error (on Windows) involving a
single line of libwebsockets.h. So when LWS (with SSL support compiled
in) is installed on Windows using NSIS, 3rd party programs would need to
install OpenSSL and configure their program to look for OpenSSL header
files so the line with the SSL_CTX definition doesn't fail to compile.

I hope this is not the intention.

Cheers, Mark
>
> Cheers,
>
> Roger
>
>
> On Sun, Nov 1, 2015 at 2:48 AM, Mark Hessling <andy.green at linaro.org> wrote:
>> I upgraded my version of LWS from 1.3 to 1.5 and can no longer build my
>> Rexx interface to LWS.
>>
>> The problem is that libwebsockets.h 1.5 has removed the #ifdef that
>> surrounded #include "lws_config.h".  The first problem is that
>> lws_config.h is not in a directory that is usually included, nor is it
>> included as a file to install in the *.nsi that builds the Windows
>> installer.
>>
>> If lws_config.h is made available for inclusion, errors occur on
>> #include <openssl/ssl.h> because certainly on my machine OpenSSL is
>> installed in a location like c:\OpenSSL-Win32.
>>
>> It appears that the only reason for exposing lws_config.h to builds
>> outside of building LWS itself is to set LWS_SIZEOFPTR; new since v1.3.
>>
>> Not sure if the resolution is to surround #include "lws_config.h" again
>> with CMAKE_BUILD and expose LWS_SIZEOFPTR some other way, or protect
>> other areas of libwebsockets.h with CMAKE_BUILD like #include
>> <openssl/ssl.h>
>>
>> Cheers, Mark
>>
>> --
>> ------------------------------------------------------------------------
>> * Mark Hessling, mark at rexx.org http://www.rexx.org/
>> * Author of THE, a Free XEDIT/KEDIT editor and, Rexx/SQL, Rexx/CURL, etc.
>> * Maintainer of Regina Rexx interpreter
>> * Use Rexx? join the Rexx Language Association: http://www.rexxla.org/
>> ------------------------------------------------------------------------
>>
>>
>> _______________________________________________
>> Libwebsockets mailing list
>> Libwebsockets at ml.libwebsockets.org
>> http://ml.libwebsockets.org/mailman/listinfo/libwebsockets

-- 
------------------------------------------------------------------------
* Mark Hessling, mark at rexx.org http://www.rexx.org/
* Author of THE, a Free XEDIT/KEDIT editor and, Rexx/SQL, Rexx/CURL, etc.
* Maintainer of Regina Rexx interpreter
* Use Rexx? join the Rexx Language Association: http://www.rexxla.org/ 
------------------------------------------------------------------------





More information about the Libwebsockets mailing list