[Libwebsockets] how do I detect if a given connection is SSL if LWS_SERVER_OPTION_ALLOW_NON_SSL_ON_SSL_PORT is used?

Michael Haberler mail17 at mah.priv.at
Sun Aug 17 13:04:52 CEST 2014


Am 16.08.2014 um 04:25 schrieb Andy Green <andy at warmcat.com>:

> From: Andy Green <andy at warmcat.com>
> Sent: 16 August 2014 10:02:06 GMT+08:00
> To: Michael Haberler <mail17 at mah.priv.at>
> Subject: Re: [Libwebsockets] how do I detect if a given connection is SSL if	LWS_SERVER_OPTION_ALLOW_NON_SSL_ON_SSL_PORT is used?
> 
> 
> 
> On 16 August 2014 05:23:20 GMT+08:00, Michael Haberler <mail17 at mah.priv.at> wrote:
> 
> the way I read it LWS_SERVER_OPTION_ALLOW_NON_SSL_ON_SSL_PORT would
> allow both ws: and wss: (and http+https)
> 
> if so, I'd need to tell those apart per-connection; how would I test
> for this?
> 
> There's no way until now... you're right, adding that option means you can have both kinds of connections and you may want to handle them differently in user code.
> 
> I added an accessor function for it from the wsi here -->
> 
> http://git.libwebsockets.org/cgi-bin/cgit/libwebsockets/commit/?id=b128ccccca1d359637a99b2e5a6b342cfcbd63aa

thanks - that and the protocols id field really make things a lot more flexible during connection setup!


- Michael


> 
> -Andy
> 
> thanks,
> 
> - Michael
> 
> 
> Libwebsockets mailing list
> Libwebsockets at ml.libwebsockets.org
> http://ml.libwebsockets.org/mailman/listinfo/libwebsockets
> _______________________________________________
> Libwebsockets mailing list
> Libwebsockets at ml.libwebsockets.org
> http://ml.libwebsockets.org/mailman/listinfo/libwebsockets




More information about the Libwebsockets mailing list