diff --git a/.github/build_windows_openssl_old.bat b/.github/build_windows_openssl_old.bat index 93d7278fea..172504f6ae 100644 --- a/.github/build_windows_openssl_old.bat +++ b/.github/build_windows_openssl_old.bat @@ -1,5 +1,6 @@ call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64 mkdir build cd build +cmd.exe /c cmake -G "NMake Makefiles" .. cmake -G "NMake Makefiles" -DBUILD_TEST=TRUE -DENABLE_AWS_SDK_IN_TESTS=OFF -DBUILD_LEGACY_OPENSSL_VERSION=ON -DEXT_PTHREAD_INCLUDE_DIR="C:/tools/pthreads-w32-2-9-1-release/Pre-built.2/include/" -DEXT_PTHREAD_LIBRARIES="C:/tools/pthreads-w32-2-9-1-release/Pre-built.2/lib/x64/libpthreadGC2.a" .. nmake \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 90cbca5c8e..85fab7f3f3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: runs-on: macos-latest steps: - name: Clone repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install clang-format run: | brew install clang-format @@ -33,9 +33,9 @@ jobs: contents: read steps: - name: Clone repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v2 + uses: aws-actions/configure-aws-credentials@v4 with: role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} aws-region: ${{ secrets.AWS_REGION }} @@ -59,9 +59,9 @@ jobs: contents: read steps: - name: Clone repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v2 + uses: aws-actions/configure-aws-credentials@v4 with: role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} aws-region: ${{ secrets.AWS_REGION }} @@ -85,9 +85,9 @@ jobs: contents: read steps: - name: Clone repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v2 + uses: aws-actions/configure-aws-credentials@v4 with: role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} aws-region: ${{ secrets.AWS_REGION }} @@ -109,9 +109,9 @@ jobs: contents: read steps: - name: Clone repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v2 + uses: aws-actions/configure-aws-credentials@v4 with: role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} aws-region: ${{ secrets.AWS_REGION }} @@ -134,9 +134,9 @@ jobs: contents: read steps: - name: Clone repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v2 + uses: aws-actions/configure-aws-credentials@v4 with: role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} aws-region: ${{ secrets.AWS_REGION }} @@ -159,9 +159,9 @@ jobs: contents: read steps: - name: Clone repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v2 + uses: aws-actions/configure-aws-credentials@v4 with: role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} aws-region: ${{ secrets.AWS_REGION }} @@ -187,9 +187,9 @@ jobs: contents: read steps: - name: Clone repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v2 + uses: aws-actions/configure-aws-credentials@v4 with: role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} aws-region: ${{ secrets.AWS_REGION }} @@ -222,9 +222,9 @@ jobs: contents: read steps: - name: Clone repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v2 + uses: aws-actions/configure-aws-credentials@v4 with: role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} aws-region: ${{ secrets.AWS_REGION }} @@ -253,7 +253,7 @@ jobs: # AWS_KVS_LOG_LEVEL: 2 # steps: # - name: Clone repository - # uses: actions/checkout@v3 + # uses: actions/checkout@v4 # - name: Install dependencies # run: | # sudo apt clean && sudo apt update @@ -278,9 +278,9 @@ jobs: contents: read steps: - name: Clone repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v2 + uses: aws-actions/configure-aws-credentials@v4 with: role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} aws-region: ${{ secrets.AWS_REGION }} @@ -310,9 +310,9 @@ jobs: contents: read steps: - name: Clone repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v2 + uses: aws-actions/configure-aws-credentials@v4 with: role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} aws-region: ${{ secrets.AWS_REGION }} @@ -351,7 +351,7 @@ jobs: contents: read steps: - name: Clone repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install dependencies run: | apk update @@ -371,9 +371,9 @@ jobs: contents: read steps: - name: Clone repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v2 + uses: aws-actions/configure-aws-credentials@v4 with: role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} aws-region: ${{ secrets.AWS_REGION }} @@ -407,9 +407,9 @@ jobs: contents: read steps: - name: Clone repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v2 + uses: aws-actions/configure-aws-credentials@v4 with: role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} aws-region: ${{ secrets.AWS_REGION }} @@ -443,9 +443,9 @@ jobs: contents: read steps: - name: Clone repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v2 + uses: aws-actions/configure-aws-credentials@v4 with: role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} aws-region: ${{ secrets.AWS_REGION }} @@ -467,7 +467,7 @@ jobs: timeout --signal=SIGABRT 60m ./tst/webrtc_client_test sample-check: if: github.repository == 'awslabs/amazon-kinesis-video-streams-webrtc-sdk-c' - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 env: AWS_KVS_LOG_LEVEL: 2 permissions: @@ -481,18 +481,16 @@ jobs: with: role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} aws-region: ${{ secrets.AWS_REGION }} - role-duration-seconds: 10800 - name: Build repository run: | sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6' mkdir build && cd build cmake .. make - - name: Sample check - run: | + cd .. ./scripts/check-sample.sh ubuntu-os-build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest env: AWS_KVS_LOG_LEVEL: 2 permissions: @@ -500,9 +498,9 @@ jobs: contents: read steps: - name: Clone repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v2 + uses: aws-actions/configure-aws-credentials@v4 with: role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} aws-region: ${{ secrets.AWS_REGION }} @@ -522,7 +520,7 @@ jobs: cd build timeout --signal=SIGABRT 60m ./tst/webrtc_client_test ubuntu-os-build-openssl-old: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 env: AWS_KVS_LOG_LEVEL: 2 permissions: @@ -530,9 +528,9 @@ jobs: contents: read steps: - name: Clone repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v2 + uses: aws-actions/configure-aws-credentials@v4 with: role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} aws-region: ${{ secrets.AWS_REGION }} @@ -540,13 +538,12 @@ jobs: run: | sudo apt clean && sudo apt update sudo apt-get -y install libcurl4-openssl-dev - openssl version - name: Build repository run: | # TODO: Remove the following line. This is only a workaround for enabling IPv6, https://github.com/travis-ci/travis-ci/issues/8891. sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6' mkdir build && cd build - cmake .. -DBUILD_TEST=TRUE -DBUILD_OLD_OPENSSL_VERSION=ON -DENABLE_AWS_SDK_IN_TESTS=OFF + cmake .. -DBUILD_TEST=TRUE -DBUILD_OLD_OPENSSL_VERSION=ON make - name: Run tests run: | @@ -561,9 +558,9 @@ jobs: contents: read steps: - name: Clone repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v2 + uses: aws-actions/configure-aws-credentials@v4 with: role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} aws-region: ${{ secrets.AWS_REGION }} @@ -614,9 +611,9 @@ jobs: contents: read steps: - name: Clone repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v2 + uses: aws-actions/configure-aws-credentials@v4 with: role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} aws-region: ${{ secrets.AWS_REGION }} @@ -665,7 +662,7 @@ jobs: # AWS_KVS_LOG_LEVEL: 7 # steps: # - name: Clone repository - # uses: actions/checkout@v3 + # uses: actions/checkout@v4 # - name: Move cloned repo # shell: powershell # run: | @@ -698,7 +695,7 @@ jobs: sudo apt clean && sudo apt update sudo apt-get -y install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu - name: Clone repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Build Repository run: | sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6' @@ -716,7 +713,7 @@ jobs: sudo apt clean && sudo apt update sudo apt-get -y install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu - name: Clone repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Build Repository run: | sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6' @@ -734,7 +731,7 @@ jobs: sudo apt clean && sudo apt update sudo apt-get -y install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu - name: Clone repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Build Repository run: | sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6' @@ -752,7 +749,7 @@ jobs: sudo apt clean && sudo apt update sudo apt-get -y install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu - name: Clone repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Build Repository run: | sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6' @@ -770,7 +767,7 @@ jobs: sudo apt clean && sudo apt update sudo apt-get -y install gcc-arm-linux-gnueabi g++-arm-linux-gnueabi binutils-arm-linux-gnueabi - name: Clone repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Build Repository run: | sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6' @@ -788,7 +785,7 @@ jobs: sudo apt clean && sudo apt update sudo apt-get -y install gcc-arm-linux-gnueabi g++-arm-linux-gnueabi binutils-arm-linux-gnueabi - name: Clone repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Build Repository run: | sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6' diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 50432e72be..f2b65edf38 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -10,7 +10,7 @@ on: - master jobs: linux-gcc-codecov: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest env: AWS_KVS_LOG_LEVEL: 2 permissions: diff --git a/CMakeLists.txt b/CMakeLists.txt index a8d2d18ca9..f0ebb69b79 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -159,28 +159,26 @@ if(BUILD_DEPENDENCIES) set(OPENSSL_INCLUDE_DIRS "${OPEN_SRC_INSTALL_PREFIX}/include/") set(OPENSSL_CRYPTO_LIBRARY "${OPEN_SRC_INSTALL_PREFIX}/lib/libcrypto.lib") set(OPENSSL_SSL_LIBRARY "${OPEN_SRC_INSTALL_PREFIX}/lib/libssl.lib") - message(STATUS "Openssl lib path set to: ${OPENSSL_SSL_LIBRARY}") - message(STATUS "Openssl crypto path set to: ${OPENSSL_CRYPTO_LIBRARY}") set(OPENSSL_LIBRARIES ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY}) string(REPLACE ";" "|" OPENSSL_LIBRARIES_ALT_SEP "${OPENSSL_LIBRARIES}") set(BUILD_ARGS -DBUILD_STATIC_LIBS=${BUILD_STATIC_LIBS} - -DUSE_OPENSSL=${USE_OPENSSL} - -DUSE_MBEDTLS=${USE_MBEDTLS} - -DLWS_EXT_PTHREAD_INCLUDE_DIR=${EXT_PTHREAD_INCLUDE_DIR} - -DLWS_EXT_PTHREAD_LIBRARIES=${EXT_PTHREAD_LIBRARIES} - -DLWS_OPENSSL_INCLUDE_DIRS=${OPENSSL_INCLUDE_DIRS} - -DLWS_OPENSSL_LIBRARIES=${OPENSSL_LIBRARIES_ALT_SEP} - -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}) + -DUSE_OPENSSL=${USE_OPENSSL} + -DUSE_MBEDTLS=${USE_MBEDTLS} + -DLWS_EXT_PTHREAD_INCLUDE_DIR=${EXT_PTHREAD_INCLUDE_DIR} + -DLWS_EXT_PTHREAD_LIBRARIES=${EXT_PTHREAD_LIBRARIES} + -DLWS_OPENSSL_INCLUDE_DIRS=${OPENSSL_INCLUDE_DIRS} + -DLWS_OPENSSL_LIBRARIES=${OPENSSL_LIBRARIES_ALT_SEP} + -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}) else() set(BUILD_ARGS -DBUILD_STATIC_LIBS=${BUILD_STATIC_LIBS} - -DOPENSSL_DIR=${OPEN_SRC_INSTALL_PREFIX} - -DUSE_OPENSSL=${USE_OPENSSL} - -DUSE_MBEDTLS=${USE_MBEDTLS} - -DLWS_OPENSSL_CRYPTO_LIBRARY=${OPENSSL_CRYPTO_LIBRARY} - -DLWS_OPENSSL_SSL_LIBRARY=${OPENSSL_SSL_LIBRARY} - -DLWS_OPENSSL_INCLUDE_DIRS=${OPENSSL_INCLUDE_DIR} - -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}) + -DOPENSSL_DIR=${OPEN_SRC_INSTALL_PREFIX} + -DUSE_OPENSSL=${USE_OPENSSL} + -DUSE_MBEDTLS=${USE_MBEDTLS} + -DLWS_OPENSSL_CRYPTO_LIBRARY=${OPENSSL_CRYPTO_LIBRARY} + -DLWS_OPENSSL_SSL_LIBRARY=${OPENSSL_SSL_LIBRARY} + -DLWS_OPENSSL_INCLUDE_DIRS=${OPENSSL_INCLUDE_DIR} + -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}) endif() build_dependency(websockets ${BUILD_ARGS}) @@ -192,7 +190,6 @@ if(BUILD_DEPENDENCIES) -DUSE_OPENSSL=${USE_OPENSSL} -DUSE_MBEDTLS=${USE_MBEDTLS} -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}) - build_dependency(srtp ${BUILD_ARGS}) set(BUILD_ARGS @@ -233,15 +230,12 @@ find_package(Threads) find_package(PkgConfig REQUIRED) if (USE_OPENSSL) find_package(OpenSSL REQUIRED) - set(OPEN_SRC_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR}) # In Windows, the openssl search paths get reset and the system openssl ends up being used if(WIN32) set(OPENSSL_INCLUDE_DIRS "${OPEN_SRC_INSTALL_PREFIX}/include/") set(OPENSSL_CRYPTO_LIBRARY "${OPEN_SRC_INSTALL_PREFIX}/lib/libcrypto.lib") set(OPENSSL_SSL_LIBRARY "${OPEN_SRC_INSTALL_PREFIX}/lib/libssl.lib") - message(STATUS "Post reset Openssl lib path set to: ${OPENSSL_SSL_LIBRARY}") - message(STATUS "Post reset Openssl crypto path set to: ${OPENSSL_CRYPTO_LIBRARY}") set(OPENSSL_LIBRARIES ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY}) string(REPLACE ";" "|" OPENSSL_LIBRARIES_ALT_SEP "${OPENSSL_LIBRARIES}") endif() @@ -387,16 +381,16 @@ endif() target_link_libraries( kvsWebrtcClient PRIVATE kvspicUtils - kvspicState - ${CMAKE_THREAD_LIBS_INIT} - ${OPENSSL_SSL_LIBRARY} - ${OPENSSL_CRYPTO_LIBRARY} - ${SRTP_LIBRARIES} - ${Usrsctp} - ${MBEDTLS_LIBRARIES} - ${GPERFTOOLS_MALLOC_LIBRARIES} - ${GPERFTOOLS_PROFILER_LIBRARIES} - ${EXTRA_DEPS}) + kvspicState + ${CMAKE_THREAD_LIBS_INIT} + ${OPENSSL_SSL_LIBRARY} + ${OPENSSL_CRYPTO_LIBRARY} + ${SRTP_LIBRARIES} + ${Usrsctp} + ${MBEDTLS_LIBRARIES} + ${GPERFTOOLS_MALLOC_LIBRARIES} + ${GPERFTOOLS_PROFILER_LIBRARIES} + ${EXTRA_DEPS}) add_library(kvsWebrtcSignalingClient ${LINKAGE} ${WEBRTC_SIGNALING_CLIENT_SOURCE_FILES}) @@ -407,17 +401,17 @@ endif() target_link_libraries( kvsWebrtcSignalingClient PUBLIC - kvsCommonLws - ${LIBWEBSOCKETS_LIBRARIES} + kvsCommonLws + ${LIBWEBSOCKETS_LIBRARIES} PRIVATE kvspicUtils - kvspicState - ${CMAKE_THREAD_LIBS_INIT} - ${EXTRA_DEPS} - ${OPENSSL_SSL_LIBRARY} - ${OPENSSL_CRYPTO_LIBRARY} - ${GPERFTOOLS_MALLOC_LIBRARIES} - ${GPERFTOOLS_PROFILER_LIBRARIES} - ${MBEDTLS_LIBRARIES}) + kvspicState + ${CMAKE_THREAD_LIBS_INIT} + ${EXTRA_DEPS} + ${OPENSSL_SSL_LIBRARY} + ${OPENSSL_CRYPTO_LIBRARY} + ${GPERFTOOLS_MALLOC_LIBRARIES} + ${GPERFTOOLS_PROFILER_LIBRARIES} + ${MBEDTLS_LIBRARIES}) if (WIN32) target_link_libraries(kvsWebrtcClient PRIVATE "Ws2_32" "iphlpapi") diff --git a/src/source/Signaling/LwsApiCalls.c b/src/source/Signaling/LwsApiCalls.c index ecf3fb091a..b696157da7 100644 --- a/src/source/Signaling/LwsApiCalls.c +++ b/src/source/Signaling/LwsApiCalls.c @@ -57,7 +57,7 @@ INT32 lwsHttpCallbackRoutine(struct lws* wsi, enum lws_callback_reasons reason, customData = lws_get_opaque_user_data(wsi); pLwsCallInfo = (PLwsCallInfo) customData; - lws_set_log_level(LLL_NOTICE | LLL_WARN | LLL_ERR | LLL_DEBUG, NULL); + lws_set_log_level(LLL_NOTICE | LLL_WARN | LLL_ERR, NULL); CHK(pLwsCallInfo != NULL && pLwsCallInfo->pSignalingClient != NULL && pLwsCallInfo->pSignalingClient->pLwsContext != NULL && pLwsCallInfo->callInfo.pRequestInfo != NULL && pLwsCallInfo->protocolIndex == PROTOCOL_INDEX_HTTPS,