File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -448,12 +448,17 @@ static void s_aws_http_on_stream_complete_tls_proxy(struct aws_http_stream *stre
448448 context -> state = AWS_PBS_TLS_NEGOTIATION ;
449449 struct aws_channel * channel = aws_http_connection_get_channel (context -> connection );
450450
451- /*
452- * TODO: if making secure (double TLS) proxy connection, we need to go after the second slot:
453- *
454- * Socket -> TLS(proxy) -> TLS(origin server) -> Http
455- */
456- if (channel == NULL || s_vtable -> setup_client_tls (aws_channel_get_first_slot (channel ), context -> tls_options )) {
451+ struct aws_channel_slot * left_of_tls_slot = aws_channel_get_first_slot (channel );
452+ if (context -> proxy_config -> tls_options != NULL ) {
453+ /*
454+ * If making secure (double TLS) proxy connection, we need to go after the second slot:
455+ *
456+ * Socket -> TLS(proxy) -> TLS(origin server) -> Http
457+ */
458+ left_of_tls_slot = left_of_tls_slot -> adj_right ;
459+ }
460+
461+ if (s_vtable -> setup_client_tls (left_of_tls_slot , context -> tls_options )) {
457462 AWS_LOGF_ERROR (
458463 AWS_LS_HTTP_CONNECTION ,
459464 "(%p) Proxy connection failed to start TLS negotiation with error %d(%s)" ,
You can’t perform that action at this time.
0 commit comments