From bab2295fc3cceaa2b2606e152e5f416c33e03576 Mon Sep 17 00:00:00 2001 From: Benjamin Sergeant Date: Thu, 3 Oct 2019 09:41:17 -0700 Subject: [PATCH] make sure the unittest pass withouth SSL --- makefile | 4 ++++ test/IXHttpClientTest.cpp | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/makefile b/makefile index dd259f52..4cee6581 100644 --- a/makefile +++ b/makefile @@ -84,6 +84,10 @@ test_mbedtls: mkdir -p build && (cd build ; cmake -DCMAKE_BUILD_TYPE=Debug -DUSE_TLS=1 -DUSE_MBED_TLS=1 -DUSE_TEST=1 .. ; make -j 4) (cd test ; python2.7 run.py -r) +test_no_ssl: + mkdir -p build && (cd build ; cmake -DCMAKE_BUILD_TYPE=Debug -DUSE_TEST=1 .. ; make -j 4) + (cd test ; python2.7 run.py -r) + ws_test: ws (cd ws ; env DEBUG=1 PATH=../ws/build:$$PATH bash test_ws.sh) diff --git a/test/IXHttpClientTest.cpp b/test/IXHttpClientTest.cpp index 3e98b0ac..735dcdb1 100644 --- a/test/IXHttpClientTest.cpp +++ b/test/IXHttpClientTest.cpp @@ -50,6 +50,7 @@ TEST_CASE("http_client", "[http]") REQUIRE(response->statusCode == 200); } +#ifdef IXWEBSOCKET_USE_TLS SECTION("Connect to a remote HTTPS server") { HttpClient httpClient; @@ -91,6 +92,7 @@ TEST_CASE("http_client", "[http]") REQUIRE(response->errorCode == HttpErrorCode::Ok); REQUIRE(response->statusCode == 200); } +#endif SECTION("Async API, one call") { @@ -102,7 +104,7 @@ TEST_CASE("http_client", "[http]") tlsOptions.caFile = "cacert.pem"; httpClient.setTLSOptions(tlsOptions); - std::string url("https://httpbin.org/"); + std::string url("http://httpbin.org/"); auto args = httpClient.createRequest(url); args->extraHeaders = headers;