@@ -1125,12 +1125,12 @@ static int s_aws_http_client_connect_via_tunneling_proxy(
11251125
11261126static enum aws_http_proxy_connection_type s_determine_proxy_connection_type (
11271127 enum aws_http_proxy_connection_type proxy_connection_type ,
1128- const struct aws_tls_connection_options * tls_options ) {
1128+ bool is_tls_connection ) {
11291129 if (proxy_connection_type != AWS_HPCT_HTTP_LEGACY ) {
11301130 return proxy_connection_type ;
11311131 }
11321132
1133- if (tls_options != NULL ) {
1133+ if (is_tls_connection ) {
11341134 return AWS_HPCT_HTTP_TUNNEL ;
11351135 } else {
11361136 return AWS_HPCT_HTTP_FORWARD ;
@@ -1184,7 +1184,7 @@ static int s_connect_proxy(const struct aws_http_client_connection_options *opti
11841184 }
11851185
11861186 enum aws_http_proxy_connection_type proxy_connection_type =
1187- s_determine_proxy_connection_type (options -> proxy_options -> connection_type , options -> tls_options );
1187+ s_determine_proxy_connection_type (options -> proxy_options -> connection_type , options -> tls_options != NULL );
11881188
11891189 switch (proxy_connection_type ) {
11901190 case AWS_HPCT_HTTP_FORWARD :
@@ -1398,7 +1398,7 @@ struct aws_http_proxy_config *aws_http_proxy_config_new_from_connection_options(
13981398 return s_aws_http_proxy_config_new (
13991399 allocator ,
14001400 options -> proxy_options ,
1401- s_determine_proxy_connection_type (options -> proxy_options -> connection_type , options -> tls_options ));
1401+ s_determine_proxy_connection_type (options -> proxy_options -> connection_type , options -> tls_options != NULL ));
14021402}
14031403
14041404struct aws_http_proxy_config * aws_http_proxy_config_new_from_manager_options (
@@ -1410,7 +1410,8 @@ struct aws_http_proxy_config *aws_http_proxy_config_new_from_manager_options(
14101410 return s_aws_http_proxy_config_new (
14111411 allocator ,
14121412 options -> proxy_options ,
1413- s_determine_proxy_connection_type (options -> proxy_options -> connection_type , options -> tls_connection_options ));
1413+ s_determine_proxy_connection_type (
1414+ options -> proxy_options -> connection_type , options -> tls_connection_options != NULL ));
14141415}
14151416
14161417struct aws_http_proxy_config * aws_http_proxy_config_new_tunneling_from_proxy_options (
@@ -1431,6 +1432,16 @@ struct aws_http_proxy_config *aws_http_proxy_config_new_from_proxy_options(
14311432 return s_aws_http_proxy_config_new (allocator , proxy_options , proxy_options -> connection_type );
14321433}
14331434
1435+ struct aws_http_proxy_config * aws_http_proxy_config_new_from_proxy_options_with_tls_info (
1436+ struct aws_allocator * allocator ,
1437+ const struct aws_http_proxy_options * proxy_options ,
1438+ bool is_tls_connection ) {
1439+ AWS_FATAL_ASSERT (proxy_options != NULL );
1440+
1441+ return s_aws_http_proxy_config_new (
1442+ allocator , proxy_options , s_determine_proxy_connection_type (proxy_options -> connection_type , is_tls_connection ));
1443+ }
1444+
14341445struct aws_http_proxy_config * aws_http_proxy_config_new_clone (
14351446 struct aws_allocator * allocator ,
14361447 const struct aws_http_proxy_config * proxy_config ) {
0 commit comments