diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3bef0aba7..0b61da7a7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,6 +79,15 @@ jobs: aws s3 cp s3://aws-crt-test-stuff/ci/${{ env.BUILDER_VERSION }}/linux-container-ci.sh ./linux-container-ci.sh && chmod a+x ./linux-container-ci.sh ./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ env.LINUX_BASE_IMAGE }} build -p ${{ env.PACKAGE_NAME }} --cmake-extra=-DBUILD_SHARED_LIBS=ON + byo-crypto: + runs-on: ubuntu-latest + steps: + # We can't use the `uses: docker://image` version yet, GitHub lacks authentication for actions -> packages + - name: Build ${{ env.PACKAGE_NAME }} + run: | + aws s3 cp s3://aws-crt-test-stuff/ci/${{ env.BUILDER_VERSION }}/linux-container-ci.sh ./linux-container-ci.sh && chmod a+x ./linux-container-ci.sh + ./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ env.LINUX_BASE_IMAGE }} build -p ${{ env.PACKAGE_NAME }} --cmake-extra=-DBYO_CRYPTO=ON downstream + windows: runs-on: windows-latest steps: diff --git a/CMakeLists.txt b/CMakeLists.txt index 862e0d55a..2471669d9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -96,10 +96,9 @@ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake" COMPONENT Development) include(CTest) -if (BUILD_TESTING) +if (NOT BYO_CRYPTO AND BUILD_TESTING) add_subdirectory(tests) - - if (NOT CMAKE_CROSSCOMPILING ) + if (NOT CMAKE_CROSSCOMPILING) add_subdirectory(bin/elasticurl) endif() endif() diff --git a/integration-testing/http_client_test.py b/integration-testing/http_client_test.py index 33d22eed6..5ba8f45bd 100644 --- a/integration-testing/http_client_test.py +++ b/integration-testing/http_client_test.py @@ -5,6 +5,7 @@ import sys import urllib.request import unittest +import os.path TIMEOUT = 100 @@ -14,6 +15,13 @@ print('You must pass the elasticurl cmd prefix') sys.exit(-1) +program_to_run = elasticurl_cmd_prefix[0] + +if 'bin' in program_to_run: + if not os.path.exists(program_to_run): + print('the program_to_run is not found, skip integration test') + sys.exit(0) + # Remove args from sys.argv so that unittest doesn't also try to parse them. sys.argv = sys.argv[:1] diff --git a/source/proxy_connection.c b/source/proxy_connection.c index 22ff452c3..86a976432 100644 --- a/source/proxy_connection.c +++ b/source/proxy_connection.c @@ -34,7 +34,9 @@ AWS_STATIC_STRING_FROM_LITERAL(s_http_proxy_env_var_low, "http_proxy"); AWS_STATIC_STRING_FROM_LITERAL(s_https_proxy_env_var, "HTTPS_PROXY"); AWS_STATIC_STRING_FROM_LITERAL(s_https_proxy_env_var_low, "https_proxy"); +#ifndef BYO_CRYPTO AWS_STATIC_STRING_FROM_LITERAL(s_proxy_no_verify_peer_env_var, "AWS_PROXY_NO_VERIFY_PEER"); +#endif static struct aws_http_proxy_system_vtable s_default_vtable = { .setup_client_tls = &aws_channel_setup_client_tls, @@ -1136,9 +1138,18 @@ static int s_setup_proxy_tls_env_variable( struct aws_tls_connection_options *default_tls_connection_options, struct aws_http_proxy_options *proxy_options, struct aws_uri *proxy_uri) { + (void)default_tls_connection_options; + (void)proxy_uri; if (options->proxy_ev_settings->tls_options) { proxy_options->tls_options = options->proxy_ev_settings->tls_options; } else { +#ifdef BYO_CRYPTO + AWS_LOGF_ERROR( + AWS_LS_HTTP_CONNECTION, + "Failed making default TLS context because of BYO_CRYPTO, set up the tls_options for proxy_env_settings to " + "make it work."); + return AWS_OP_ERR; +#else struct aws_tls_ctx *tls_ctx = NULL; struct aws_tls_ctx_options tls_ctx_options; AWS_ZERO_STRUCT(tls_ctx_options); @@ -1167,6 +1178,7 @@ static int s_setup_proxy_tls_env_variable( return AWS_OP_ERR; } proxy_options->tls_options = default_tls_connection_options; +#endif } return AWS_OP_SUCCESS; }