mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
cmake: fix things ignoring LWS_WITH_TLS
This commit is contained in:
parent
8584c973fa
commit
62c328244c
4 changed files with 7 additions and 0 deletions
|
@ -714,6 +714,7 @@ lws_ss_create(struct lws_context *context, int tsi, const lws_ss_info_t *ssi,
|
|||
*ppp = NULL;
|
||||
i.pprotocols = pprot;
|
||||
|
||||
#if defined(LWS_WITH_TLS)
|
||||
if (h->policy->flags & LWSSSPOLF_TLS) {
|
||||
i.options |= LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT;
|
||||
i.server_ssl_cert_mem =
|
||||
|
@ -725,6 +726,7 @@ lws_ss_create(struct lws_context *context, int tsi, const lws_ss_info_t *ssi,
|
|||
i.server_ssl_private_key_mem_len = (unsigned int)
|
||||
h->policy->trust.server.key->ca_der_len;
|
||||
}
|
||||
#endif
|
||||
|
||||
vho = lws_create_vhost(context, &i);
|
||||
if (!vho) {
|
||||
|
|
|
@ -82,11 +82,13 @@ int main(int argc, const char **argv)
|
|||
info.options =
|
||||
LWS_SERVER_OPTION_HTTP_HEADERS_SECURITY_BEST_PRACTICES_ENFORCE;
|
||||
|
||||
#if defined(LWS_WITH_TLS)
|
||||
if (lws_cmdline_option(argc, argv, "-s")) {
|
||||
info.options |= LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT;
|
||||
info.ssl_cert_filepath = "localhost-100y.cert";
|
||||
info.ssl_private_key_filepath = "localhost-100y.key";
|
||||
}
|
||||
#endif
|
||||
|
||||
context = lws_create_context(&info);
|
||||
if (!context) {
|
||||
|
|
|
@ -13,6 +13,7 @@ set(requirements 1)
|
|||
require_pthreads(requirements)
|
||||
require_lws_config(LWS_ROLE_H1 1 requirements)
|
||||
require_lws_config(LWS_WITH_SERVER 1 requirements)
|
||||
require_lws_config(LWS_WITH_TLS 1 requirements)
|
||||
|
||||
CHECK_C_SOURCE_COMPILES("#include <libwebsockets.h>\nint main(void) {\n#if defined(LWS_WITH_LIBUV)\n return 0;\n#else\n fail;\n#endif\n return 0;\n}\n" LWS_WITH_LIBUV)
|
||||
CHECK_C_SOURCE_COMPILES("#include <libwebsockets.h>\nint main(void) {\n#if defined(LWS_WITH_LIBEVENT)\n return 0;\n#else\n fail;\n#endif\n return 0;\n}\n" LWS_WITH_LIBEVENT)
|
||||
|
|
|
@ -106,6 +106,7 @@ int main(int argc, const char **argv)
|
|||
info.listen_accept_role = "raw-proxy";
|
||||
info.listen_accept_protocol = "raw-proxy";
|
||||
|
||||
#if defined(LWS_WITH_TLS)
|
||||
if (lws_cmdline_option(argc, argv, "-s")) {
|
||||
info.options |= LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT |
|
||||
LWS_SERVER_OPTION_ALLOW_NON_SSL_ON_SSL_PORT;
|
||||
|
@ -118,6 +119,7 @@ int main(int argc, const char **argv)
|
|||
if (lws_cmdline_option(argc, argv, "-h"))
|
||||
info.options |= LWS_SERVER_OPTION_ALLOW_HTTP_ON_HTTPS_LISTENER;
|
||||
}
|
||||
#endif
|
||||
|
||||
context = lws_create_context(&info);
|
||||
if (!context) {
|
||||
|
|
Loading…
Add table
Reference in a new issue