Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 2 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
8 changes: 8 additions & 0 deletions integration-testing/http_client_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import sys
import urllib.request
import unittest
import os.path

TIMEOUT = 100

Expand All @@ -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]

Expand Down
12 changes: 12 additions & 0 deletions source/proxy_connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}
Expand Down