mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
LWS_SERVER_OPTION_ALLOW_NON_SSL_ON_SSL_PORT: fixes after tls refactor
https://github.com/warmcat/libwebsockets/issues/1191
This commit is contained in:
parent
36620a2ffe
commit
3e3c270f76
3 changed files with 5 additions and 2 deletions
|
@ -103,6 +103,9 @@ int lws_h2_configure_if_upgraded(struct lws *wsi)
|
|||
char cstr[10];
|
||||
unsigned len;
|
||||
|
||||
if (!wsi->ssl)
|
||||
return 0;
|
||||
|
||||
SSL_get0_alpn_selected(wsi->ssl, &name, &len);
|
||||
if (!len) {
|
||||
lwsl_info("no ALPN upgrade\n");
|
||||
|
|
|
@ -155,7 +155,7 @@ lws_ssl_server_name_cb(SSL *ssl, int *ad, void *arg)
|
|||
*/
|
||||
vh = context->vhost_list;
|
||||
while (vh) {
|
||||
if (!vh->being_destroyed && vh->ssl_ctx == SSL_get_SSL_CTX(ssl))
|
||||
if (!vh->being_destroyed && ssl && vh->ssl_ctx == SSL_get_SSL_CTX(ssl))
|
||||
break;
|
||||
vh = vh->vhost_next;
|
||||
}
|
||||
|
|
|
@ -904,7 +904,7 @@ accepted:
|
|||
/* adapt our vhost to match the SNI SSL_CTX that was chosen */
|
||||
vh = context->vhost_list;
|
||||
while (vh) {
|
||||
if (!vh->being_destroyed &&
|
||||
if (!vh->being_destroyed && wsi->ssl &&
|
||||
vh->ssl_ctx == SSL_get_SSL_CTX(wsi->ssl)) {
|
||||
lwsl_info("setting wsi to vh %s\n", vh->name);
|
||||
wsi->vhost = vh;
|
||||
|
|
Loading…
Add table
Reference in a new issue