[Libwebsockets] Reconfigure vhost with certificates.

Andy Green andy at warmcat.com
Fri Jun 4 06:15:35 CEST 2021



On 6/3/21 5:07 PM, Avigail Wilk wrote:
> Hi Andy,
> 
> I am using libwebsocket version 4.2.0.
> 
> In my system I give the end user the option to upload ssl certificates 
> that will be used for HTTPS.
> 
> My question is, what is the right way to restart the vhost with the new 
> certificates?

The usual approach routers take is use the new certs on the next reboot.

There are also apis to destroy and create vhosts dynamically.

https://libwebsockets.org/git/libwebsockets/tree/include/libwebsockets/lws-context-vhost.h?h=main#n1005-1037

> And how can I validate that the certificates that the user uploaded are 
> valid? (when I tried using invalid certs to initiate a vhost, my program 
> just got stuck and I had to use kill -9 to kill it…)

Where did it get "stuck"?  Just "stuck", or "failed" or that kind of 
thing are not actionable as debugging reports.  You should be able to, 
eg, attach gdb and find out a backtrace.

-Andy

> Thanks a lot for your help!
> 
> 
> 
> This message has been scanned for malware by Websense. www.websense.com 
> <http://www.websense.com/>
> 


More information about the Libwebsockets mailing list