1
0
Fork 0
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:
Andy Green 2018-02-27 08:26:01 +08:00
parent 36620a2ffe
commit 3e3c270f76
3 changed files with 5 additions and 2 deletions

View file

@ -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");

View file

@ -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;
}

View file

@ -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;