[Libwebsockets] Problem using SSL with CONTEXT_PORT_NO_LISTEN

Andy Green andy at warmcat.com
Wed Dec 14 14:14:03 CET 2016


On Tue, 2016-12-13 at 16:38 -0500, Alan Conway wrote:
> I ran into a problem trying to get SSL to work with adopted sockets:
> 
> In ssl-server.c:
> 
> lws_context_init_server_ssl(struct lws_context_creation_info *info,
> 			    struct lws_vhost *vhost)
> {
> /// Snip...
> 	if (info->port != CONTEXT_PORT_NO_LISTEN) {
> 
> 		vhost->use_ssl = info->ssl_cert_filepath != NULL;
> 
> In other words, SSL is explicitly disabled if I use
> CONTEXT_PORT_NO_LISTEN, which I have to do since I don't want LWS to
> listen directly.
> 
> Is there another way around this?

As I wrote offlist, you've come to the end of the "paved road" for
this.

You're the first person using lws with external SSL, you are going to
discover some things need adapting, because lws was written for a
different (more popular...) use-case.

So far I don't see any particular inherent problem with what you want.

But the released versions and master don't do what you want.  Even you
didn't know what you wanted wrt this before yesterday.

So for features beyond what you have, you will have to target patching
lws, and lws making a release that does do what you want, then
packaging that (or some other solution... but lws pretty much does what
you want.)

-Andy

> Thanks,
> Alan.
> _______________________________________________
> Libwebsockets mailing list
> Libwebsockets at ml.libwebsockets.org
> https://libwebsockets.org/mailman/listinfo/libwebsockets



More information about the Libwebsockets mailing list