Skip to content

Commit

Permalink
MB-61583: Set explicit connection verify
Browse files Browse the repository at this point in the history
Erlang 26 introduced an incompatible change:

* the default value for the verify option is now verify_peer
  instead of verify_none.

As a result, for secure uploads, we explicitly set verify_none as it is no
longer the default value.

Change-Id: I169d82b001164e1d0d99f1b33ddd3ed67a4664b4
Reviewed-on: https://review.couchbase.org/c/ns_server/+/208889
Well-Formed: Build Bot <build@couchbase.com>
Reviewed-by: Timofey Barmin <timofey.barmin@couchbase.com>
Tested-by: Steve Watanabe <steve.watanabe@couchbase.com>
Tested-by: Build Bot <build@couchbase.com>
  • Loading branch information
stevewatanabe committed Apr 26, 2024
1 parent 064195b commit 821b2ca
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions apps/ns_server/src/cluster_logs_collection_task.erl
Original file line number Diff line number Diff line change
Expand Up @@ -384,14 +384,24 @@ preflight_base_url(BaseURL, {upload_proxy, URL}) ->
BaseURL,
[{proxy, URL},
{proxy_ssl_options,
[{server_name_indication, Host}]}]);
[{server_name_indication, Host}]}] ++
build_connect_options(BaseURL));
{error, _} = Error ->
Error
end;
preflight_base_url(BaseURL, false) ->
preflight_lhttpc_request("Base", BaseURL, []).
preflight_lhttpc_request("Base", BaseURL, build_connect_options(BaseURL)).

preflight_proxy_url(false) ->
ok;
preflight_proxy_url({upload_proxy, URL}) ->
preflight_lhttpc_request("Proxy", URL, []).
preflight_lhttpc_request("Proxy", URL, build_connect_options(URL)).

build_connect_options(URL) ->
case URL of
"https://" ++ _ ->
[{connect_options,
[{verify, verify_none}]}];
"http://" ++ _ ->
[]
end.

0 comments on commit 821b2ca

Please sign in to comment.