Skip to content

Commit

Permalink
MB-47905: MB-52125: Use client cert in pluggableUI proxy calls...
Browse files Browse the repository at this point in the history
... when necessary

Change-Id: I25716df03a4b6e185e1f7184f79709dc285b2ce0
Reviewed-on: https://review.couchbase.org/c/ns_server/+/174773
Well-Formed: Build Bot <build@couchbase.com>
Tested-by: Timofey Barmin <timofey.barmin@couchbase.com>
Reviewed-by: Artem Stemkovski <artem@couchbase.com>
Reviewed-by: Steve Watanabe <steve.watanabe@couchbase.com>
  • Loading branch information
timofey-barmin committed May 26, 2022
1 parent ed4e34d commit e600391
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/menelaus_util.erl
Expand Up @@ -685,12 +685,18 @@ choose_node_consistently(Req, Nodes) ->
lists:nth(N, Nodes).

proxy_req({Scheme, Host, Port, AFamily}, Path, Headers, Timeout,
RespHeaderFilterFun, Req) ->
RespHeaderFilterFun, Req) when is_atom(Scheme) ->
Method = mochiweb_request:get(method, Req),
Body = get_body(Req),
TLSOpts = case Scheme of
https ->
ns_ssl_services_setup:tls_client_opts(ns_config:latest());
http ->
[]
end,
Options = [{partial_download, [{window_size, ?WINDOW_SIZE},
{part_size, ?PART_SIZE}]},
{connect_options, [AFamily]}],
{connect_options, [AFamily | TLSOpts]}],
Resp = lhttpc:request(Host, Port, Scheme =:= https, Path, Method, Headers,
Body, Timeout, Options),
handle_resp(Resp, RespHeaderFilterFun, Req).
Expand Down

0 comments on commit e600391

Please sign in to comment.