Skip to content

Commit 8b5f98b

Browse files
committed
use build flag instead
1 parent ee0a808 commit 8b5f98b

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

source/connection.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,10 +1058,12 @@ int aws_http_client_connect_internal(
10581058
return aws_raise_error(AWS_ERROR_INVALID_ARGUMENT);
10591059
}
10601060

1061-
if (aws_is_using_secitem() && proxy_request_transform) {
1062-
AWS_LOGF_ERROR(AWS_LS_HTTP_PROXY_NEGOTIATION, "HTTP proxy is not supported with Apple Network Framework.");
1061+
#if defined(AWS_USE_SECITEM) && defined(AWS_OS_APPLE)
1062+
if (proxy_request_transform) {
1063+
AWS_LOGF_ERROR(AWS_LS_HTTP_PROXY_NEGOTIATION, "HTTP proxy is not supported on Apple Network Framework.");
10631064
return aws_raise_error(AWS_ERROR_PLATFORM_NOT_SUPPORTED);
10641065
}
1066+
#endif
10651067

10661068
struct aws_http_client_bootstrap *http_bootstrap = NULL;
10671069
struct aws_string *host_name = NULL;

source/proxy_connection.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <aws/common/encoding.h>
1010
#include <aws/common/environment.h>
1111
#include <aws/common/hash_table.h>
12+
#include <aws/common/platform.h>
1213
#include <aws/common/string.h>
1314
#include <aws/http/connection_manager.h>
1415
#include <aws/http/private/connection_impl.h>
@@ -1565,10 +1566,12 @@ int aws_http_options_validate_proxy_configuration(const struct aws_http_client_c
15651566
return aws_raise_error(AWS_ERROR_INVALID_ARGUMENT);
15661567
}
15671568

1568-
if (aws_is_using_secitem() && (options->proxy_options || options->proxy_ev_settings)) {
1569-
AWS_LOGF_ERROR(AWS_LS_HTTP_PROXY_NEGOTIATION, "HTTP proxy is not supported with Apple Network Framework.");
1569+
#if defined(AWS_USE_SECITEM) && defined(AWS_OS_APPLE)
1570+
if ((options->proxy_options || options->proxy_ev_settings)) {
1571+
AWS_LOGF_ERROR(AWS_LS_HTTP_PROXY_NEGOTIATION, "HTTP proxy is not supported on Apple Network Framework.");
15701572
return aws_raise_error(AWS_ERROR_PLATFORM_NOT_SUPPORTED);
15711573
}
1574+
#endif
15721575

15731576
enum aws_http_proxy_connection_type proxy_type = options->proxy_options->connection_type;
15741577
if (proxy_type == AWS_HPCT_HTTP_FORWARD && options->tls_options != NULL) {

0 commit comments

Comments
 (0)