diff options
author | Andy Green <andy@warmcat.com> | 2021-07-27 11:08:08 +0100 |
---|---|---|
committer | Andy Green <andy@warmcat.com> | 2021-07-30 11:32:27 +0100 |
commit | d18d7a3643812fab1941bcf2be514af102a3f93b (patch) | |
tree | 186469c60fc170e5c0070553bcba45e68548fd64 /lib/roles | |
parent | fac7c5bf9c076f5217444b6007a8cb5520427e79 (diff) | |
download | libwebsockets-d18d7a3643812fab1941bcf2be514af102a3f93b.tar.gz |
http: redir: to tls from none
Diffstat (limited to 'lib/roles')
-rw-r--r-- | lib/roles/http/client/client-http.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/roles/http/client/client-http.c b/lib/roles/http/client/client-http.c index ebdea820..4014eed8 100644 --- a/lib/roles/http/client/client-http.c +++ b/lib/roles/http/client/client-http.c @@ -1626,12 +1626,16 @@ lws_client_reset(struct lws **pwsi, int ssl, const char *address, int port, wsi->flags = (wsi->flags & (~LCCSCF_USE_SSL)) | (ssl ? LCCSCF_USE_SSL : 0); + if (!cisin[CIS_ALPN] || !cisin[CIS_ALPN][0]) +#if defined(LWS_ROLE_H2) + cisin[CIS_ALPN] = "h2,http/1.1"; +#else + cisin[CIS_ALPN] = "http/1.1"; +#endif + lwsl_notice("%s: REDIRECT %s:%d, path='%s', ssl = %d, alpn='%s'\n", __func__, address, port, path, ssl, cisin[CIS_ALPN]); - if (!cisin[CIS_ALPN][0]) - assert(0); - lws_pt_lock(pt, __func__); __remove_wsi_socket_from_fds(wsi); lws_pt_unlock(pt); |