diff --git a/README.md b/README.md
index 851c5b987e3c32600e0dd224aa479c8acaeb58d5..0d60a88cf3496c9bb8f98442f9099e27eb526b5f 100644
--- a/README.md
+++ b/README.md
@@ -10,10 +10,10 @@ News
 
 ## Lws has the first official ws-over-h2 server support
 
-There's a new standard on the RFC track that enabled multiplexing ws connections
+There's a new standard on the RFC track that enables multiplexing ws connections
 over an http/2 link.  Compared to making individual tcp and tls connections for
 each ws link back to the same server, this makes your site start up radically
-faster, and since all the connections are in one tls tunnel, with much memory
+faster, and since all the connections are in one tls tunnel, with considerable memory
 reduction serverside.
 
 To enable it on master you just need -DLWS_WITH_HTTP2=1 at cmake.  No changes to
@@ -22,16 +22,17 @@ apis if you return your own headers, as shown in the test apps for several versi
 or to take advantage of ws-over-h2.  When built with http/2 support, it automatically
 falls back to http/1 and traditional ws upgrade if that's all the client can handle.
 
-Currently only Chrome Canary v67 supports this ws-over-h2 encapsulation but the other
-browsers will catch up soon.
+Currently only Chrome Canary v67 supports this ws-over-h2 encapsulation (chrome
+must be started with `--enable-websocket-over-http2` switch to enable it currently)
+but the other browsers will catch up soon.
 
 ## New "minimal examples"
 
 https://github.com/warmcat/libwebsockets/tree/master/minimal-examples
 
-These are like the test apps, but focus on doing one thing, the best way, with the minimum amount of code.  For example the minimal-http-server serves the cwd on http/1 or http/2 in 50 LOC.
+These are like the test apps, but focus on doing one thing, the best way, with the minimum amount of code.  For example the minimal-http-server serves the cwd on http/1 or http/2 in 50 LOC.  Same thing with tls is just three more lines.
 
-They also build standalone, so it's easier to copy them directly to start your own project; they
+They build standalone, so it's easier to copy them directly to start your own project; they
 are CC0 licensed (public domain) to facilitate that.
 
 ## Windows binary builds
diff --git a/lib/tls/openssl/openssl-server.c b/lib/tls/openssl/openssl-server.c
index ab24af4cf69e07dac6c88f25032cb0568e2f8fad..0c7f8c92c798fc063a4985ca98390cc73b71eee2 100644
--- a/lib/tls/openssl/openssl-server.c
+++ b/lib/tls/openssl/openssl-server.c
@@ -280,7 +280,7 @@ check_key:
 	if (extra_certs)
 		x = sk_X509_value(extra_certs, 0);
 	else
-		lwsl_err("%s: no extra certs\n", __func__);
+		lwsl_info("%s: no extra certs\n", __func__);
 #endif
 	if (!x) {
 		//lwsl_err("%s: x is NULL\n", __func__);
diff --git a/minimal-examples/client-server/minimal-ws-proxy/CMakeLists.txt b/minimal-examples/client-server/minimal-ws-proxy/CMakeLists.txt
index 006d260e23adf5632c7ceabbd96b78d0c15a8422..c3f7521c058f3ba11641d5b7761f37f5dc87feee 100644
--- a/minimal-examples/client-server/minimal-ws-proxy/CMakeLists.txt
+++ b/minimal-examples/client-server/minimal-ws-proxy/CMakeLists.txt
@@ -1,5 +1,5 @@
 cmake_minimum_required(VERSION 2.8)
-include(CheckSymbolExists)
+include(CheckCSourceCompiles)
 
 set(SAMP lws-minimal-ws-proxy)
 set(SRCS minimal-ws-proxy.c)
@@ -39,16 +39,17 @@ MACRO(require_lws_config reqconfig _val result)
 		if (LWS_WITH_MINIMAL_EXAMPLES)
 			set(MET ${SAME})
 		else()
-			CHECK_SYMBOL_EXISTS(${reqconfig} libwebsockets.h HAS)
-			if (NOT DEFINED HAS)
-				set(HAS 0)
+			CHECK_C_SOURCE_COMPILES("#include <libwebsockets.h>\nint main(void) {\n#if defined(${reqconfig})\n return 0;\n#else\n fail;\n#endif\n return 0;\n}\n" HAS_${reqconfig})
+			if (NOT DEFINED HAS_${reqconfig} OR NOT HAS_${reqconfig})
+				set(HAS_${reqconfig} 0)
+			else()
+				set(HAS_${reqconfig} 1)
 			endif()
-			if ((HAS AND ${_val}) OR (NOT HAS AND NOT ${_val}))
+			if ((HAS_${reqconfig} AND ${_val}) OR (NOT HAS_${reqconfig} AND NOT ${_val}))
 				set(MET 1)
 			else()
 				set(MET 0)
 			endif()
-	
 		endif()
 		if (NOT MET)
 			if (${_val})
diff --git a/minimal-examples/http-client/minimal-http-client/CMakeLists.txt b/minimal-examples/http-client/minimal-http-client/CMakeLists.txt
index 511362ed97c05bb38406cfbd6ffd8cba1bedd277..f8b222cf93f4c98455ff3ef515173398942a1ea7 100644
--- a/minimal-examples/http-client/minimal-http-client/CMakeLists.txt
+++ b/minimal-examples/http-client/minimal-http-client/CMakeLists.txt
@@ -1,5 +1,5 @@
 cmake_minimum_required(VERSION 2.8)
-include(CheckSymbolExists)
+include(CheckCSourceCompiles)
 
 set(SAMP lws-minimal-http-client)
 set(SRCS minimal-http-client.c)
@@ -39,16 +39,17 @@ MACRO(require_lws_config reqconfig _val result)
 		if (LWS_WITH_MINIMAL_EXAMPLES)
 			set(MET ${SAME})
 		else()
-			CHECK_SYMBOL_EXISTS(${reqconfig} libwebsockets.h HAS)
-			if (NOT DEFINED HAS)
-				set(HAS 0)
+			CHECK_C_SOURCE_COMPILES("#include <libwebsockets.h>\nint main(void) {\n#if defined(${reqconfig})\n return 0;\n#else\n fail;\n#endif\n return 0;\n}\n" HAS_${reqconfig})
+			if (NOT DEFINED HAS_${reqconfig} OR NOT HAS_${reqconfig})
+				set(HAS_${reqconfig} 0)
+			else()
+				set(HAS_${reqconfig} 1)
 			endif()
-			if ((HAS AND ${_val}) OR (NOT HAS AND NOT ${_val}))
+			if ((HAS_${reqconfig} AND ${_val}) OR (NOT HAS_${reqconfig} AND NOT ${_val}))
 				set(MET 1)
 			else()
 				set(MET 0)
 			endif()
-	
 		endif()
 		if (NOT MET)
 			if (${_val})
@@ -61,6 +62,7 @@ MACRO(require_lws_config reqconfig _val result)
 	endif()
 ENDMACRO()
 
+
 set(requirements 1)
 require_lws_config(LWS_WITHOUT_CLIENT 0 requirements)
 
diff --git a/minimal-examples/http-server/README.md b/minimal-examples/http-server/README.md
index 59535d8ef1aacde9986bdb95be1f373ff975c241..034e89d8bdb81d6d9f0aeb1eb86fd7e93aeccb0c 100644
--- a/minimal-examples/http-server/README.md
+++ b/minimal-examples/http-server/README.md
@@ -1,6 +1,7 @@
 |Example|Demonstrates|
 ---|---
-minimal-http-server|Serves a directory over http/1 or http/2, custom 404 handler
+minimal-http-server|Serves a directory over http/1, custom 404 handler
+minimal-http-server-tls|Serves a directory over http/1 or http/2 with TLS (SSL), custom 404 handler
 minimal-http-server-libuv|Same as minimal-http-server but libuv event loop
 minimal-http-server-multivhost|Same as minimal-http-server but three different vhosts
 minimal-http-server-smp|Multiple service threads
diff --git a/minimal-examples/http-server/minimal-http-server-dynamic/CMakeLists.txt b/minimal-examples/http-server/minimal-http-server-dynamic/CMakeLists.txt
index 2943e46fd534d3ca18a1ad0208b229c6994a55dc..3286a4199e1d63754d42f74d56c3ee78e5d3d07b 100644
--- a/minimal-examples/http-server/minimal-http-server-dynamic/CMakeLists.txt
+++ b/minimal-examples/http-server/minimal-http-server-dynamic/CMakeLists.txt
@@ -1,5 +1,5 @@
 cmake_minimum_required(VERSION 2.8)
-include(CheckSymbolExists)
+include(CheckCSourceCompiles)
 
 set(SAMP lws-minimal-http-server-dynamic)
 set(SRCS minimal-http-server-dynamic.c)
@@ -39,16 +39,17 @@ MACRO(require_lws_config reqconfig _val result)
 		if (LWS_WITH_MINIMAL_EXAMPLES)
 			set(MET ${SAME})
 		else()
-			CHECK_SYMBOL_EXISTS(${reqconfig} libwebsockets.h HAS)
-			if (NOT DEFINED HAS)
-				set(HAS 0)
+			CHECK_C_SOURCE_COMPILES("#include <libwebsockets.h>\nint main(void) {\n#if defined(${reqconfig})\n return 0;\n#else\n fail;\n#endif\n return 0;\n}\n" HAS_${reqconfig})
+			if (NOT DEFINED HAS_${reqconfig} OR NOT HAS_${reqconfig})
+				set(HAS_${reqconfig} 0)
+			else()
+				set(HAS_${reqconfig} 1)
 			endif()
-			if ((HAS AND ${_val}) OR (NOT HAS AND NOT ${_val}))
+			if ((HAS_${reqconfig} AND ${_val}) OR (NOT HAS_${reqconfig} AND NOT ${_val}))
 				set(MET 1)
 			else()
 				set(MET 0)
 			endif()
-	
 		endif()
 		if (NOT MET)
 			if (${_val})
diff --git a/minimal-examples/http-server/minimal-http-server-libuv/CMakeLists.txt b/minimal-examples/http-server/minimal-http-server-libuv/CMakeLists.txt
index 3a2a0e5adee668687f07f638eae9d22f4e268649..dc56dcdd3e93c1ea358d0ff114adbac5bbed1cc7 100644
--- a/minimal-examples/http-server/minimal-http-server-libuv/CMakeLists.txt
+++ b/minimal-examples/http-server/minimal-http-server-libuv/CMakeLists.txt
@@ -1,5 +1,5 @@
 cmake_minimum_required(VERSION 2.8)
-include(CheckSymbolExists)
+include(CheckCSourceCompiles)
 
 set(SAMP lws-minimal-http-server-libuv)
 set(SRCS minimal-http-server.c)
@@ -39,16 +39,17 @@ MACRO(require_lws_config reqconfig _val result)
 		if (LWS_WITH_MINIMAL_EXAMPLES)
 			set(MET ${SAME})
 		else()
-			CHECK_SYMBOL_EXISTS(${reqconfig} libwebsockets.h HAS)
-			if (NOT DEFINED HAS)
-				set(HAS 0)
+			CHECK_C_SOURCE_COMPILES("#include <libwebsockets.h>\nint main(void) {\n#if defined(${reqconfig})\n return 0;\n#else\n fail;\n#endif\n return 0;\n}\n" HAS_${reqconfig})
+			if (NOT DEFINED HAS_${reqconfig} OR NOT HAS_${reqconfig})
+				set(HAS_${reqconfig} 0)
+			else()
+				set(HAS_${reqconfig} 1)
 			endif()
-			if ((HAS AND ${_val}) OR (NOT HAS AND NOT ${_val}))
+			if ((HAS_${reqconfig} AND ${_val}) OR (NOT HAS_${reqconfig} AND NOT ${_val}))
 				set(MET 1)
 			else()
 				set(MET 0)
 			endif()
-	
 		endif()
 		if (NOT MET)
 			if (${_val})
diff --git a/minimal-examples/http-server/minimal-http-server-multivhost/CMakeLists.txt b/minimal-examples/http-server/minimal-http-server-multivhost/CMakeLists.txt
index 5684ff2fac24f5cdba8c09bfdc30c0da5cbfb5f6..ae0400dd3c9f59d30d82bb6a92bb770553777e35 100644
--- a/minimal-examples/http-server/minimal-http-server-multivhost/CMakeLists.txt
+++ b/minimal-examples/http-server/minimal-http-server-multivhost/CMakeLists.txt
@@ -1,5 +1,5 @@
 cmake_minimum_required(VERSION 2.8)
-include(CheckSymbolExists)
+include(CheckCSourceCompiles)
 
 set(SAMP lws-minimal-http-server-multivhost)
 set(SRCS minimal-http-server.c)
@@ -39,16 +39,17 @@ MACRO(require_lws_config reqconfig _val result)
 		if (LWS_WITH_MINIMAL_EXAMPLES)
 			set(MET ${SAME})
 		else()
-			CHECK_SYMBOL_EXISTS(${reqconfig} libwebsockets.h HAS)
-			if (NOT DEFINED HAS)
-				set(HAS 0)
+			CHECK_C_SOURCE_COMPILES("#include <libwebsockets.h>\nint main(void) {\n#if defined(${reqconfig})\n return 0;\n#else\n fail;\n#endif\n return 0;\n}\n" HAS_${reqconfig})
+			if (NOT DEFINED HAS_${reqconfig} OR NOT HAS_${reqconfig})
+				set(HAS_${reqconfig} 0)
+			else()
+				set(HAS_${reqconfig} 1)
 			endif()
-			if ((HAS AND ${_val}) OR (NOT HAS AND NOT ${_val}))
+			if ((HAS_${reqconfig} AND ${_val}) OR (NOT HAS_${reqconfig} AND NOT ${_val}))
 				set(MET 1)
 			else()
 				set(MET 0)
 			endif()
-	
 		endif()
 		if (NOT MET)
 			if (${_val})
@@ -60,7 +61,6 @@ MACRO(require_lws_config reqconfig _val result)
 	
 	endif()
 ENDMACRO()
-
 set(requirements 1)
 require_lws_config(LWS_WITHOUT_SERVER 0 requirements)
 
diff --git a/minimal-examples/http-server/minimal-http-server-smp/CMakeLists.txt b/minimal-examples/http-server/minimal-http-server-smp/CMakeLists.txt
index 59f49b751c8589860037c87e79f905f79c625df9..fedd1550221633c4e3a711b505d86bb4e8fb32a7 100644
--- a/minimal-examples/http-server/minimal-http-server-smp/CMakeLists.txt
+++ b/minimal-examples/http-server/minimal-http-server-smp/CMakeLists.txt
@@ -1,6 +1,6 @@
 cmake_minimum_required(VERSION 2.8)
 include(CheckIncludeFile)
-include(CheckSymbolExists)
+include(CheckCSourceCompiles)
 
 set(SAMP lws-minimal-http-server-smp)
 set(SRCS minimal-http-server-smp.c)
@@ -51,16 +51,17 @@ MACRO(require_lws_config reqconfig _val result)
 		if (LWS_WITH_MINIMAL_EXAMPLES)
 			set(MET ${SAME})
 		else()
-			CHECK_SYMBOL_EXISTS(${reqconfig} libwebsockets.h HAS)
-			if (NOT DEFINED HAS)
-				set(HAS 0)
+			CHECK_C_SOURCE_COMPILES("#include <libwebsockets.h>\nint main(void) {\n#if defined(${reqconfig})\n return 0;\n#else\n fail;\n#endif\n return 0;\n}\n" HAS_${reqconfig})
+			if (NOT DEFINED HAS_${reqconfig} OR NOT HAS_${reqconfig})
+				set(HAS_${reqconfig} 0)
+			else()
+				set(HAS_${reqconfig} 1)
 			endif()
-			if ((HAS AND ${_val}) OR (NOT HAS AND NOT ${_val}))
+			if ((HAS_${reqconfig} AND ${_val}) OR (NOT HAS_${reqconfig} AND NOT ${_val}))
 				set(MET 1)
 			else()
 				set(MET 0)
 			endif()
-	
 		endif()
 		if (NOT MET)
 			if (${_val})
diff --git a/minimal-examples/http-server/minimal-http-server-tls/CMakeLists.txt b/minimal-examples/http-server/minimal-http-server-tls/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..7c8e7d62b16b137ae16acbef5f0bf37f9d380438
--- /dev/null
+++ b/minimal-examples/http-server/minimal-http-server-tls/CMakeLists.txt
@@ -0,0 +1,78 @@
+cmake_minimum_required(VERSION 2.8)
+include(CheckCSourceCompiles)
+
+set(SAMP lws-minimal-http-server-tls)
+set(SRCS minimal-http-server-tls.c)
+
+# If we are being built as part of lws, confirm current build config supports
+# reqconfig, else skip building ourselves.
+#
+# If we are being built externally, confirm installed lws was configured to
+# support reqconfig, else error out with a helpful message about the problem.
+#
+MACRO(require_lws_config reqconfig _val result)
+
+	if (DEFINED ${reqconfig})
+	if (${reqconfig})
+		set (rq 1)
+	else()
+		set (rq 0)
+	endif()
+	else()
+		set(rq 0)
+	endif()
+
+	if (${_val} EQUAL ${rq})
+		set(SAME 1)
+	else()
+		set(SAME 0)
+	endif()
+
+	if (LWS_WITH_MINIMAL_EXAMPLES AND NOT ${SAME})
+		if (${_val})
+			message("${SAMP}: skipping as lws being built without ${reqconfig}")
+		else()
+			message("${SAMP}: skipping as lws built with ${reqconfig}")
+		endif()
+		set(${result} 0)
+	else()
+		if (LWS_WITH_MINIMAL_EXAMPLES)
+			set(MET ${SAME})
+		else()
+			CHECK_C_SOURCE_COMPILES("#include <libwebsockets.h>\nint main(void) {\n#if defined(${reqconfig})\n return 0;\n#else\n fail;\n#endif\n return 0;\n}\n" HAS_${reqconfig})
+			if (NOT DEFINED HAS_${reqconfig} OR NOT HAS_${reqconfig})
+				set(HAS_${reqconfig} 0)
+			else()
+				set(HAS_${reqconfig} 1)
+			endif()
+			if ((HAS_${reqconfig} AND ${_val}) OR (NOT HAS_${reqconfig} AND NOT ${_val}))
+				set(MET 1)
+			else()
+				set(MET 0)
+			endif()
+		endif()
+		if (NOT MET)
+			if (${_val})
+				message(FATAL_ERROR "This project requires lws must have been configured with ${reqconfig}")
+			else()
+				message(FATAL_ERROR "Lws configuration of ${reqconfig} is incompatible with this project")
+			endif()
+		endif()
+	
+	endif()
+ENDMACRO()
+
+set(requirements 1)
+require_lws_config(LWS_WITHOUT_SERVER 0 requirements)
+require_lws_config(LWS_OPENSSL_SUPPORT 1 requirements)
+
+if (requirements)
+	add_executable(${SAMP} ${SRCS})
+
+	if (websockets_shared)
+		target_link_libraries(${SAMP} websockets_shared)
+		add_dependencies(${SAMP} websockets_shared)
+	else()
+		target_link_libraries(${SAMP} websockets)
+	endif()
+endif()
diff --git a/minimal-examples/http-server/minimal-http-server-tls/README.md b/minimal-examples/http-server/minimal-http-server-tls/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..b10ffed69c5c84dfd2b4199bdee4b74a36a56642
--- /dev/null
+++ b/minimal-examples/http-server/minimal-http-server-tls/README.md
@@ -0,0 +1,45 @@
+# lws minimal http server with tls
+
+## build
+
+```
+ $ cmake . && make
+```
+
+## usage
+
+```
+ $ ./lws-minimal-http-server-tls
+[2018/03/20 13:23:13:0131] USER: LWS minimal http server TLS | visit https://localhost:7681
+[2018/03/20 13:23:13:0142] NOTICE: Creating Vhost 'default' port 7681, 1 protocols, IPv6 off
+[2018/03/20 13:23:13:0142] NOTICE:  Using SSL mode
+[2018/03/20 13:23:13:0146] NOTICE:  SSL ECDH curve 'prime256v1'
+[2018/03/20 13:23:13:0146] NOTICE:  HTTP2 / ALPN enabled
+[2018/03/20 13:23:13:0195] NOTICE: lws_tls_client_create_vhost_context: doing cert filepath localhost-100y.cert
+[2018/03/20 13:23:13:0195] NOTICE: Loaded client cert localhost-100y.cert
+[2018/03/20 13:23:13:0195] NOTICE: lws_tls_client_create_vhost_context: doing private key filepath
+[2018/03/20 13:23:13:0196] NOTICE: Loaded client cert private key localhost-100y.key
+[2018/03/20 13:23:13:0196] NOTICE: created client ssl context for default
+[2018/03/20 13:23:14:0207] NOTICE:    vhost default: cert expiry: 730459d
+```
+
+Visit https://localhost:7681
+
+Because it uses a selfsigned certificate, you will have to make an exception for it in your browser.
+
+## Certificate creation
+
+The selfsigned certs provided were created with
+
+```
+echo -e "GB\nErewhon\nAll around\nlibwebsockets-test\n\nlocalhost\nnone@invalid.org\n" | openssl req -new -newkey rsa:4096 -days 36500 -nodes -x509 -keyout "localhost-100y.key" -out "localhost-100y.cert"
+```
+
+they cover "localhost" and last 100 years from 2018-03-20.
+
+You can replace them with commercial certificates matching your hostname.
+
+## HTTP/2
+
+If you built lws with `-DLWS_WITH_HTTP2=1` at cmake, this simple server is also http/2 capable
+out of the box.  If the index.html was loaded over http/2, it will display an HTTP 2 png.
diff --git a/minimal-examples/http-server/minimal-http-server-tls/localhost-100y.cert b/minimal-examples/http-server/minimal-http-server-tls/localhost-100y.cert
new file mode 100644
index 0000000000000000000000000000000000000000..6f372db40ad29f5bc1e0463078d48f2bd8d5c60c
--- /dev/null
+++ b/minimal-examples/http-server/minimal-http-server-tls/localhost-100y.cert
@@ -0,0 +1,34 @@
+-----BEGIN CERTIFICATE-----
+MIIF5jCCA86gAwIBAgIJANq50IuwPFKgMA0GCSqGSIb3DQEBCwUAMIGGMQswC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MTvP/AuehKXncBJhYtW0ltTioVx+5yTYSAZWl+IssmXjefxJqYi2/7QWmv1QC9p
+sNcjTMaBQLN03T1Qelbs7Y27sxdEnNUth4kI+wIDAQABo1MwUTAdBgNVHQ4EFgQU
+9mYU23tW2zsomkKTAXarjr2vjuswHwYDVR0jBBgwFoAU9mYU23tW2zsomkKTAXar
+jr2vjuswDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAgEANjIBMrow
+YNCbhAJdP7dhlhT2RUFRdeRUJD0IxrH/hkvb6myHHnK8nOYezFPjUlmRKUgNEDuA
+xbnXZzPdCRNV9V2mShbXvCyiDY7WCQE2Bn44z26O0uWVk+7DNNLH9BnkwUtOnM9P
+wtmD9phWexm4q2GnTsiL6Ul6cy0QlTJWKVLEUQQ6yda582e23J1AXqtqFcpfoE34
+H3afEiGy882b+ZBiwkeV+oq6XVF8sFyr9zYrv9CvWTYlkpTQfLTZSsgPdEHYVcjv
+xQ2D+XyDR0aRLRlvxUa9dHGFHLICG34Juq5Ai6lM1EsoD8HSsJpMcmrH7MWw2cKk
+ujC3rMdFTtte83wF1uuF4FjUC72+SmcQN7A386BC/nk2TTsJawTDzqwOu/VdZv2g
+1WpTHlumlClZeP+G/jkSyDwqNnTu1aodDmUa4xZodfhP1HWPwUKFcq8oQr148QYA
+AOlbUOJQU7QwRWd1VbnwhDtQWXC92A2w1n/xkZSR1BM/NUSDhkBSUU1WjMbWg6Gg
+mnIZLRerQCu1Oozr87rOQqQakPkyt8BUSNK3K42j2qcfhAONdRl8Hq8Qs5pupy+s
+8sdCGDlwR3JNCMv6u48OK87F4mcIxhkSefFJUFII25pCGN5WtE4p5l+9cnO1GrIX
+e2Hl/7M0c/lbZ4FvXgARlex2rkgS0Ka06HE=
+-----END CERTIFICATE-----
diff --git a/minimal-examples/http-server/minimal-http-server-tls/localhost-100y.key b/minimal-examples/http-server/minimal-http-server-tls/localhost-100y.key
new file mode 100644
index 0000000000000000000000000000000000000000..148f8598ee1b61bcdfd35bba618fb010d8772f39
--- /dev/null
+++ b/minimal-examples/http-server/minimal-http-server-tls/localhost-100y.key
@@ -0,0 +1,52 @@
+-----BEGIN PRIVATE KEY-----
+MIIJQwIBADANBgkqhkiG9w0BAQEFAASCCS0wggkpAgEAAoICAQCjYtuWaICCY0tJ
+PubxpIgIL+WWmz/fmK8IQr11Wtee6/IUyUlo5I602mq1qcLhT/kmpoR8Di3DAmHK
+nSWdPWtn1BtXLErLlUiHgZDrZWInmEBjKM1DZf+CvNGZ+EzPgBv5nTekLWcfI5ZZ
+toGuIP1Dl/IkNDw8zFz4cpiMe/BFGemyxdHhLrKHSm8Eo+nT734tItnHKT/m6DSU
+0xlZ13d6ehLRm7/+Nx47M3XMTRH5qKP/7TTE2s0U6+M0tsGI2zpRi+m6jzhNyMBT
+J1u58qAe3ZW5/+YAiuZYAB6n5bhUp4oFuB5wYbcBywVR8ujInpF8buWQUjy5N8pS
+Np7szdYsnLJpvAd0sibrNPjC0FQCNrpNjgJmIK3+mKk4kXX7ZTwefoAzTK4l2pHN
+uC53QVc/EF++GBLAxmvCDq9ZpMIYi7OmzkkAKKC9Ue6Ef217LFQCFIBKIzv9cgi9
+fwPMLhrKleoVRNsecBsCP569WgJXhUnwf2lon4fEZr3+vRuc9shfqnV0nPN1IMSn
+zXCast7I2fiuRXdIz96KjlGQpP4XfNVA+RGL7aMnWOFIaVrKWLzAtgzoGMTvP/Au
+ehKXncBJhYtW0ltTioVx+5yTYSAZWl+IssmXjefxJqYi2/7QWmv1QC9psNcjTMaB
+QLN03T1Qelbs7Y27sxdEnNUth4kI+wIDAQABAoICAFWe8MQZb37k2gdAV3Y6aq8f
+qokKQqbCNLd3giGFwYkezHXoJfg6Di7oZxNcKyw35LFEghkgtQqErQqo35VPIoH+
+vXUpWOjnCmM4muFA9/cX6mYMc8TmJsg0ewLdBCOZVw+wPABlaqz+0UOiSMMftpk9
+fz9JwGd8ERyBsT+tk3Qi6D0vPZVsC1KqxxL/cwIFd3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VcOXvPIS2gWAs3fQlWjH9hkcQTMsUaXQDOD0aqkSY3E
+NqOvbCV1/oUpRi3076khCoAXI1bKSn/AvR3KDP14B5toHI/F5OTSEiGhhHesgRrs
+fBrpEY1IATtPq1taBZZogRqI3rOkkPk=
+-----END PRIVATE KEY-----
diff --git a/minimal-examples/http-server/minimal-http-server-tls/minimal-http-server-tls.c b/minimal-examples/http-server/minimal-http-server-tls/minimal-http-server-tls.c
new file mode 100644
index 0000000000000000000000000000000000000000..7afd0ffde278adf95369aedd42a8e5da86955586
--- /dev/null
+++ b/minimal-examples/http-server/minimal-http-server-tls/minimal-http-server-tls.c
@@ -0,0 +1,84 @@
+/*
+ * lws-minimal-http-server-tls
+ *
+ * Copyright (C) 2018 Andy Green <andy@warmcat.com>
+ *
+ * This file is made available under the Creative Commons CC0 1.0
+ * Universal Public Domain Dedication.
+ *
+ * This demonstrates the most minimal http server you can make with lws,
+ * with three extra lines giving it tls (ssl) capabilities, which in
+ * turn allow operation with HTTP/2 if lws was configured for it.
+ *
+ * To keep it simple, it serves stuff from the subdirectory 
+ * "./mount-origin" of the directory it was started in.
+ *
+ * You can change that by changing mount.origin below.
+ */
+
+#include <libwebsockets.h>
+#include <string.h>
+#include <signal.h>
+
+static int interrupted;
+
+static const struct lws_http_mount mount = {
+	/* .mount_next */		NULL,		/* linked-list "next" */
+	/* .mountpoint */		"/",		/* mountpoint URL */
+	/* .origin */			"./mount-origin", /* serve from dir */
+	/* .def */			"index.html",	/* default filename */
+	/* .protocol */			NULL,
+	/* .cgienv */			NULL,
+	/* .extra_mimetypes */		NULL,
+	/* .interpret */		NULL,
+	/* .cgi_timeout */		0,
+	/* .cache_max_age */		0,
+	/* .auth_mask */		0,
+	/* .cache_reusable */		0,
+	/* .cache_revalidate */		0,
+	/* .cache_intermediaries */	0,
+	/* .origin_protocol */		LWSMPRO_FILE,	/* files in a dir */
+	/* .mountpoint_len */		1,		/* char count */
+	/* .basic_auth_login_file */	NULL,
+};
+
+void sigint_handler(int sig)
+{
+	interrupted = 1;
+}
+
+int main(int argc, char **argv)
+{
+	struct lws_context_creation_info info;
+	struct lws_context *context;
+	int n = 0;
+
+	signal(SIGINT, sigint_handler);
+
+	memset(&info, 0, sizeof info); /* otherwise uninitialized garbage */
+	info.port = 7681;
+	info.mounts = &mount;
+	info.error_document_404 = "/404.html";
+
+	info.options = LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT;
+	info.ssl_cert_filepath = "localhost-100y.cert";
+	info.ssl_private_key_filepath = "localhost-100y.key";
+
+	lws_set_log_level(LLL_ERR | LLL_WARN | LLL_NOTICE | LLL_USER
+			/* | LLL_INFO */ /* | LLL_DEBUG */, NULL);
+
+	lwsl_user("LWS minimal http server TLS | visit https://localhost:7681\n");
+
+	context = lws_create_context(&info);
+	if (!context) {
+		lwsl_err("lws init failed\n");
+		return 1;
+	}
+
+	while (n >= 0 && !interrupted)
+		n = lws_service(context, 1000);
+
+	lws_context_destroy(context);
+
+	return 0;
+}
diff --git a/minimal-examples/http-server/minimal-http-server-tls/mount-origin/404.html b/minimal-examples/http-server/minimal-http-server-tls/mount-origin/404.html
new file mode 100644
index 0000000000000000000000000000000000000000..1f7ae66e8b080611f28f8c0e56238e53cc5b72fb
--- /dev/null
+++ b/minimal-examples/http-server/minimal-http-server-tls/mount-origin/404.html
@@ -0,0 +1,9 @@
+<meta charset="UTF-8"> 
+<html>
+	<body>
+		<img src="libwebsockets.org-logo.png"><br>
+		<h1>404</h1>
+		Sorry, that file doesn't exist.
+	</body>
+</html>
+
diff --git a/minimal-examples/http-server/minimal-http-server-tls/mount-origin/favicon.ico b/minimal-examples/http-server/minimal-http-server-tls/mount-origin/favicon.ico
new file mode 100644
index 0000000000000000000000000000000000000000..c0cc2e3dff34012ba3d4a7848a7ed17579788ec5
Binary files /dev/null and b/minimal-examples/http-server/minimal-http-server-tls/mount-origin/favicon.ico differ
diff --git a/minimal-examples/http-server/minimal-http-server-tls/mount-origin/http2.png b/minimal-examples/http-server/minimal-http-server-tls/mount-origin/http2.png
new file mode 100644
index 0000000000000000000000000000000000000000..439bfa482fa00e69af2d562f17a6e89453eb98cc
Binary files /dev/null and b/minimal-examples/http-server/minimal-http-server-tls/mount-origin/http2.png differ
diff --git a/minimal-examples/http-server/minimal-http-server-tls/mount-origin/index.html b/minimal-examples/http-server/minimal-http-server-tls/mount-origin/index.html
new file mode 100644
index 0000000000000000000000000000000000000000..d245a57dcd120a25ea771885c8a06cac57842204
--- /dev/null
+++ b/minimal-examples/http-server/minimal-http-server-tls/mount-origin/index.html
@@ -0,0 +1,39 @@
+ <meta charset="UTF-8"> 
+<html>
+	<body>
+		<img src="libwebsockets.org-logo.png"><br>
+	
+		Hello from the <b>minimal https server example</b>.
+		<br>
+		You can confirm the 404 page handler by going to this
+		nonexistant <a href="notextant.html">page</a>.
+		<br>
+		<div id="transport"></div>
+	</body>
+
+<script>
+
+window.onload = function() {
+
+var transport_protocol = "";
+
+if ( performance && performance.timing.nextHopProtocol ) {
+    transport_protocol = performance.timing.nextHopProtocol;
+} else if ( window.chrome && window.chrome.loadTimes ) {
+    transport_protocol = window.chrome.loadTimes().connectionInfo;
+} else {
+
+  var p = performance.getEntriesByType("resource");
+  for (var i=0; i < p.length; i++) {
+	var value = "nextHopProtocol" in p[i];
+	  if (value)
+	    transport_protocol = p[i].nextHopProtocol;
+    }
+   }
+   
+   if (transport_protocol == "h2")
+   	document.getElementById("transport").innerHTML = "<img src=\"/http2.png\">";
+}
+</script>
+</html>
+
diff --git a/minimal-examples/http-server/minimal-http-server-tls/mount-origin/libwebsockets.org-logo.png b/minimal-examples/http-server/minimal-http-server-tls/mount-origin/libwebsockets.org-logo.png
new file mode 100644
index 0000000000000000000000000000000000000000..2060a10c936a0959f2a5c3a6b7fa60ac324f1a95
Binary files /dev/null and b/minimal-examples/http-server/minimal-http-server-tls/mount-origin/libwebsockets.org-logo.png differ
diff --git a/minimal-examples/http-server/minimal-http-server/CMakeLists.txt b/minimal-examples/http-server/minimal-http-server/CMakeLists.txt
index 457e817a4cda9145b1fb482a8ec12534c5d3bc4e..a17d4e9f9fb7f08eb806aafae31c6220b54aa721 100644
--- a/minimal-examples/http-server/minimal-http-server/CMakeLists.txt
+++ b/minimal-examples/http-server/minimal-http-server/CMakeLists.txt
@@ -1,5 +1,5 @@
 cmake_minimum_required(VERSION 2.8)
-include(CheckSymbolExists)
+include(CheckCSourceCompiles)
 
 set(SAMP lws-minimal-http-server)
 set(SRCS minimal-http-server.c)
@@ -39,16 +39,17 @@ MACRO(require_lws_config reqconfig _val result)
 		if (LWS_WITH_MINIMAL_EXAMPLES)
 			set(MET ${SAME})
 		else()
-			CHECK_SYMBOL_EXISTS(${reqconfig} libwebsockets.h HAS)
-			if (NOT DEFINED HAS)
-				set(HAS 0)
+			CHECK_C_SOURCE_COMPILES("#include <libwebsockets.h>\nint main(void) {\n#if defined(${reqconfig})\n return 0;\n#else\n fail;\n#endif\n return 0;\n}\n" HAS_${reqconfig})
+			if (NOT DEFINED HAS_${reqconfig} OR NOT HAS_${reqconfig})
+				set(HAS_${reqconfig} 0)
+			else()
+				set(HAS_${reqconfig} 1)
 			endif()
-			if ((HAS AND ${_val}) OR (NOT HAS AND NOT ${_val}))
+			if ((HAS_${reqconfig} AND ${_val}) OR (NOT HAS_${reqconfig} AND NOT ${_val}))
 				set(MET 1)
 			else()
 				set(MET 0)
 			endif()
-	
 		endif()
 		if (NOT MET)
 			if (${_val})
@@ -61,6 +62,7 @@ MACRO(require_lws_config reqconfig _val result)
 	endif()
 ENDMACRO()
 
+
 set(requirements 1)
 require_lws_config(LWS_WITHOUT_SERVER 0 requirements)
 
diff --git a/minimal-examples/ws-client/minimal-ws-client-rx/CMakeLists.txt b/minimal-examples/ws-client/minimal-ws-client-rx/CMakeLists.txt
index 22f690143ab239cd878bedd5facc2be77365b4a6..9548db3c37f39768dbe4469fd4d0b29e032eed11 100644
--- a/minimal-examples/ws-client/minimal-ws-client-rx/CMakeLists.txt
+++ b/minimal-examples/ws-client/minimal-ws-client-rx/CMakeLists.txt
@@ -1,5 +1,5 @@
 cmake_minimum_required(VERSION 2.8)
-include(CheckSymbolExists)
+include(CheckCSourceCompiles)
 
 set(SAMP lws-minimal-ws-client-rx)
 set(SRCS minimal-ws-client.c)
@@ -39,16 +39,17 @@ MACRO(require_lws_config reqconfig _val result)
 		if (LWS_WITH_MINIMAL_EXAMPLES)
 			set(MET ${SAME})
 		else()
-			CHECK_SYMBOL_EXISTS(${reqconfig} libwebsockets.h HAS)
-			if (NOT DEFINED HAS)
-				set(HAS 0)
+			CHECK_C_SOURCE_COMPILES("#include <libwebsockets.h>\nint main(void) {\n#if defined(${reqconfig})\n return 0;\n#else\n fail;\n#endif\n return 0;\n}\n" HAS_${reqconfig})
+			if (NOT DEFINED HAS_${reqconfig} OR NOT HAS_${reqconfig})
+				set(HAS_${reqconfig} 0)
+			else()
+				set(HAS_${reqconfig} 1)
 			endif()
-			if ((HAS AND ${_val}) OR (NOT HAS AND NOT ${_val}))
+			if ((HAS_${reqconfig} AND ${_val}) OR (NOT HAS_${reqconfig} AND NOT ${_val}))
 				set(MET 1)
 			else()
 				set(MET 0)
 			endif()
-	
 		endif()
 		if (NOT MET)
 			if (${_val})
diff --git a/minimal-examples/ws-client/minimal-ws-client-tx/CMakeLists.txt b/minimal-examples/ws-client/minimal-ws-client-tx/CMakeLists.txt
index 156d7c35032e7fe559867f6b2983c0133705f173..a43e3dc67fe13cc7bd2c11b8899934e9b24d5878 100644
--- a/minimal-examples/ws-client/minimal-ws-client-tx/CMakeLists.txt
+++ b/minimal-examples/ws-client/minimal-ws-client-tx/CMakeLists.txt
@@ -1,6 +1,6 @@
 cmake_minimum_required(VERSION 2.8)
 include(CheckIncludeFile)
-include(CheckSymbolExists)
+include(CheckCSourceCompiles)
 
 set(SAMP lws-minimal-ws-client-tx)
 set(SRCS minimal-ws-client.c)
@@ -50,16 +50,17 @@ MACRO(require_lws_config reqconfig _val result)
 		if (LWS_WITH_MINIMAL_EXAMPLES)
 			set(MET ${SAME})
 		else()
-			CHECK_SYMBOL_EXISTS(${reqconfig} libwebsockets.h HAS)
-			if (NOT DEFINED HAS)
-				set(HAS 0)
+			CHECK_C_SOURCE_COMPILES("#include <libwebsockets.h>\nint main(void) {\n#if defined(${reqconfig})\n return 0;\n#else\n fail;\n#endif\n return 0;\n}\n" HAS_${reqconfig})
+			if (NOT DEFINED HAS_${reqconfig} OR NOT HAS_${reqconfig})
+				set(HAS_${reqconfig} 0)
+			else()
+				set(HAS_${reqconfig} 1)
 			endif()
-			if ((HAS AND ${_val}) OR (NOT HAS AND NOT ${_val}))
+			if ((HAS_${reqconfig} AND ${_val}) OR (NOT HAS_${reqconfig} AND NOT ${_val}))
 				set(MET 1)
 			else()
 				set(MET 0)
 			endif()
-	
 		endif()
 		if (NOT MET)
 			if (${_val})
diff --git a/minimal-examples/ws-server/minimal-ws-broker/CMakeLists.txt b/minimal-examples/ws-server/minimal-ws-broker/CMakeLists.txt
index 8ad44309fdfc3ca12d1865f8095981ac8a052c4c..73fb25a85e7cead0f44f413cf952e6a8b6ea4e79 100644
--- a/minimal-examples/ws-server/minimal-ws-broker/CMakeLists.txt
+++ b/minimal-examples/ws-server/minimal-ws-broker/CMakeLists.txt
@@ -1,5 +1,5 @@
 cmake_minimum_required(VERSION 2.8)
-include(CheckSymbolExists)
+include(CheckCSourceCompiles)
 
 set(SAMP lws-minimal-ws-broker)
 set(SRCS minimal-ws-broker.c)
@@ -39,16 +39,17 @@ MACRO(require_lws_config reqconfig _val result)
 		if (LWS_WITH_MINIMAL_EXAMPLES)
 			set(MET ${SAME})
 		else()
-			CHECK_SYMBOL_EXISTS(${reqconfig} libwebsockets.h HAS)
-			if (NOT DEFINED HAS)
-				set(HAS 0)
+			CHECK_C_SOURCE_COMPILES("#include <libwebsockets.h>\nint main(void) {\n#if defined(${reqconfig})\n return 0;\n#else\n fail;\n#endif\n return 0;\n}\n" HAS_${reqconfig})
+			if (NOT DEFINED HAS_${reqconfig} OR NOT HAS_${reqconfig})
+				set(HAS_${reqconfig} 0)
+			else()
+				set(HAS_${reqconfig} 1)
 			endif()
-			if ((HAS AND ${_val}) OR (NOT HAS AND NOT ${_val}))
+			if ((HAS_${reqconfig} AND ${_val}) OR (NOT HAS_${reqconfig} AND NOT ${_val}))
 				set(MET 1)
 			else()
 				set(MET 0)
 			endif()
-	
 		endif()
 		if (NOT MET)
 			if (${_val})
@@ -60,7 +61,6 @@ MACRO(require_lws_config reqconfig _val result)
 	
 	endif()
 ENDMACRO()
-
 set(requirements 1)
 require_lws_config(LWS_WITHOUT_SERVER 0 requirements)
 
diff --git a/minimal-examples/ws-server/minimal-ws-server-pmd-bulk/CMakeLists.txt b/minimal-examples/ws-server/minimal-ws-server-pmd-bulk/CMakeLists.txt
index 36af4b78d09b77db518cf36fa37495b1dd9d0d78..82b706526d3a7118a247fc14718ded77a192e744 100644
--- a/minimal-examples/ws-server/minimal-ws-server-pmd-bulk/CMakeLists.txt
+++ b/minimal-examples/ws-server/minimal-ws-server-pmd-bulk/CMakeLists.txt
@@ -1,5 +1,5 @@
 cmake_minimum_required(VERSION 2.8.9)
-include(CheckSymbolExists)
+include(CheckCSourceCompiles)
 
 set(SAMP lws-minimal-ws-server-pmd-bulk)
 set(SRCS minimal-ws-server-pmd-bulk.c)
@@ -39,16 +39,17 @@ MACRO(require_lws_config reqconfig _val result)
 		if (LWS_WITH_MINIMAL_EXAMPLES)
 			set(MET ${SAME})
 		else()
-			CHECK_SYMBOL_EXISTS(${reqconfig} libwebsockets.h HAS)
-			if (NOT DEFINED HAS)
-				set(HAS 0)
+			CHECK_C_SOURCE_COMPILES("#include <libwebsockets.h>\nint main(void) {\n#if defined(${reqconfig})\n return 0;\n#else\n fail;\n#endif\n return 0;\n}\n" HAS_${reqconfig})
+			if (NOT DEFINED HAS_${reqconfig} OR NOT HAS_${reqconfig})
+				set(HAS_${reqconfig} 0)
+			else()
+				set(HAS_${reqconfig} 1)
 			endif()
-			if ((HAS AND ${_val}) OR (NOT HAS AND NOT ${_val}))
+			if ((HAS_${reqconfig} AND ${_val}) OR (NOT HAS_${reqconfig} AND NOT ${_val}))
 				set(MET 1)
 			else()
 				set(MET 0)
 			endif()
-	
 		endif()
 		if (NOT MET)
 			if (${_val})
diff --git a/minimal-examples/ws-server/minimal-ws-server-pmd/CMakeLists.txt b/minimal-examples/ws-server/minimal-ws-server-pmd/CMakeLists.txt
index 8b9721b11de8b3dd1260f59aac36c2597184c448..fb607abf6a9f7d9688a5d764098e0230d12488a4 100644
--- a/minimal-examples/ws-server/minimal-ws-server-pmd/CMakeLists.txt
+++ b/minimal-examples/ws-server/minimal-ws-server-pmd/CMakeLists.txt
@@ -1,5 +1,5 @@
 cmake_minimum_required(VERSION 2.8.9)
-include(CheckSymbolExists)
+include(CheckCSourceCompiles)
 
 set(SAMP lws-minimal-ws-server-pmd)
 set(SRCS minimal-ws-server-pmd.c)
@@ -39,16 +39,17 @@ MACRO(require_lws_config reqconfig _val result)
 		if (LWS_WITH_MINIMAL_EXAMPLES)
 			set(MET ${SAME})
 		else()
-			CHECK_SYMBOL_EXISTS(${reqconfig} libwebsockets.h HAS)
-			if (NOT DEFINED HAS)
-				set(HAS 0)
+			CHECK_C_SOURCE_COMPILES("#include <libwebsockets.h>\nint main(void) {\n#if defined(${reqconfig})\n return 0;\n#else\n fail;\n#endif\n return 0;\n}\n" HAS_${reqconfig})
+			if (NOT DEFINED HAS_${reqconfig} OR NOT HAS_${reqconfig})
+				set(HAS_${reqconfig} 0)
+			else()
+				set(HAS_${reqconfig} 1)
 			endif()
-			if ((HAS AND ${_val}) OR (NOT HAS AND NOT ${_val}))
+			if ((HAS_${reqconfig} AND ${_val}) OR (NOT HAS_${reqconfig} AND NOT ${_val}))
 				set(MET 1)
 			else()
 				set(MET 0)
 			endif()
-	
 		endif()
 		if (NOT MET)
 			if (${_val})
diff --git a/minimal-examples/ws-server/minimal-ws-server-ring/CMakeLists.txt b/minimal-examples/ws-server/minimal-ws-server-ring/CMakeLists.txt
index 04e9d5bd2f6d34515728847be8ae5f5c54678fec..01445cf0e936c619047dc8ba26ade65fec4b4535 100644
--- a/minimal-examples/ws-server/minimal-ws-server-ring/CMakeLists.txt
+++ b/minimal-examples/ws-server/minimal-ws-server-ring/CMakeLists.txt
@@ -1,5 +1,5 @@
 cmake_minimum_required(VERSION 2.8)
-include(CheckSymbolExists)
+include(CheckCSourceCompiles)
 
 set(SAMP lws-minimal-ws-server-ring)
 set(SRCS minimal-ws-server.c)
@@ -39,16 +39,17 @@ MACRO(require_lws_config reqconfig _val result)
 		if (LWS_WITH_MINIMAL_EXAMPLES)
 			set(MET ${SAME})
 		else()
-			CHECK_SYMBOL_EXISTS(${reqconfig} libwebsockets.h HAS)
-			if (NOT DEFINED HAS)
-				set(HAS 0)
+			CHECK_C_SOURCE_COMPILES("#include <libwebsockets.h>\nint main(void) {\n#if defined(${reqconfig})\n return 0;\n#else\n fail;\n#endif\n return 0;\n}\n" HAS_${reqconfig})
+			if (NOT DEFINED HAS_${reqconfig} OR NOT HAS_${reqconfig})
+				set(HAS_${reqconfig} 0)
+			else()
+				set(HAS_${reqconfig} 1)
 			endif()
-			if ((HAS AND ${_val}) OR (NOT HAS AND NOT ${_val}))
+			if ((HAS_${reqconfig} AND ${_val}) OR (NOT HAS_${reqconfig} AND NOT ${_val}))
 				set(MET 1)
 			else()
 				set(MET 0)
 			endif()
-	
 		endif()
 		if (NOT MET)
 			if (${_val})
diff --git a/minimal-examples/ws-server/minimal-ws-server-threads/CMakeLists.txt b/minimal-examples/ws-server/minimal-ws-server-threads/CMakeLists.txt
index 8b147749387722480b2c322149c63eb2d64b27bc..4f2320536be7bf0824684c3e98af7ba0d67c7a92 100644
--- a/minimal-examples/ws-server/minimal-ws-server-threads/CMakeLists.txt
+++ b/minimal-examples/ws-server/minimal-ws-server-threads/CMakeLists.txt
@@ -1,6 +1,6 @@
 cmake_minimum_required(VERSION 2.8)
 include(CheckIncludeFile)
-include(CheckSymbolExists)
+include(CheckCSourceCompiles)
 
 set(SAMP lws-minimal-ws-server-threads)
 set(SRCS minimal-ws-server.c)
@@ -51,16 +51,17 @@ MACRO(require_lws_config reqconfig _val result)
 		if (LWS_WITH_MINIMAL_EXAMPLES)
 			set(MET ${SAME})
 		else()
-			CHECK_SYMBOL_EXISTS(${reqconfig} libwebsockets.h HAS)
-			if (NOT DEFINED HAS)
-				set(HAS 0)
+			CHECK_C_SOURCE_COMPILES("#include <libwebsockets.h>\nint main(void) {\n#if defined(${reqconfig})\n return 0;\n#else\n fail;\n#endif\n return 0;\n}\n" HAS_${reqconfig})
+			if (NOT DEFINED HAS_${reqconfig} OR NOT HAS_${reqconfig})
+				set(HAS_${reqconfig} 0)
+			else()
+				set(HAS_${reqconfig} 1)
 			endif()
-			if ((HAS AND ${_val}) OR (NOT HAS AND NOT ${_val}))
+			if ((HAS_${reqconfig} AND ${_val}) OR (NOT HAS_${reqconfig} AND NOT ${_val}))
 				set(MET 1)
 			else()
 				set(MET 0)
 			endif()
-	
 		endif()
 		if (NOT MET)
 			if (${_val})
diff --git a/minimal-examples/ws-server/minimal-ws-server/CMakeLists.txt b/minimal-examples/ws-server/minimal-ws-server/CMakeLists.txt
index 6ec72fe965f853cf5059f15a332f59f4ff98adec..c0cb7cbc0daa66f18af67c6de20c8d40f69d703e 100644
--- a/minimal-examples/ws-server/minimal-ws-server/CMakeLists.txt
+++ b/minimal-examples/ws-server/minimal-ws-server/CMakeLists.txt
@@ -1,5 +1,5 @@
 cmake_minimum_required(VERSION 2.8)
-include(CheckSymbolExists)
+include(CheckCSourceCompiles)
 
 set(SAMP lws-minimal-ws-server)
 set(SRCS minimal-ws-server.c)
@@ -39,16 +39,17 @@ MACRO(require_lws_config reqconfig _val result)
 		if (LWS_WITH_MINIMAL_EXAMPLES)
 			set(MET ${SAME})
 		else()
-			CHECK_SYMBOL_EXISTS(${reqconfig} libwebsockets.h HAS)
-			if (NOT DEFINED HAS)
-				set(HAS 0)
+			CHECK_C_SOURCE_COMPILES("#include <libwebsockets.h>\nint main(void) {\n#if defined(${reqconfig})\n return 0;\n#else\n fail;\n#endif\n return 0;\n}\n" HAS_${reqconfig})
+			if (NOT DEFINED HAS_${reqconfig} OR NOT HAS_${reqconfig})
+				set(HAS_${reqconfig} 0)
+			else()
+				set(HAS_${reqconfig} 1)
 			endif()
-			if ((HAS AND ${_val}) OR (NOT HAS AND NOT ${_val}))
+			if ((HAS_${reqconfig} AND ${_val}) OR (NOT HAS_${reqconfig} AND NOT ${_val}))
 				set(MET 1)
 			else()
 				set(MET 0)
 			endif()
-	
 		endif()
 		if (NOT MET)
 			if (${_val})