Sfoglia il codice sorgente

Merge pull request #2240 from tsloughter/force-tls1.2

force use of tls1.2 for http fetching to work on OTP-23-rc1
v3.13.1
Fred Hebert 5 anni fa
committed by Tristan Sloughter
parent
commit
0ba1f04bbc
Non sono state trovate chiavi note per questa firma nel database ID Chiave GPG: AAB97DDECCEB8150
3 ha cambiato i file con 10 aggiunte e 7 eliminazioni
  1. +1
    -1
      bootstrap
  2. +7
    -4
      src/r3_hex_http_httpc.erl
  3. +2
    -2
      src/rebar_utils.erl

+ 1
- 1
bootstrap Vedi File

@ -108,7 +108,7 @@ extract(Binary) ->
{ok, Contents}.
request(Url) ->
HttpOptions = [{relaxed, true} | get_proxy_auth()],
HttpOptions = [{ssl, [{versions, ['tlsv1.2']}]}, {relaxed, true} | get_proxy_auth()],
case httpc:request(get, {Url, []},
HttpOptions,

+ 7
- 4
src/r3_hex_http_httpc.erl Vedi File

@ -13,10 +13,13 @@
request(Method, URI, ReqHeaders, Body, AdapterConfig) ->
Profile = maps:get(profile, AdapterConfig, default),
Request = build_request(URI, ReqHeaders, Body),
{ok, {{_, StatusCode, _}, RespHeaders, RespBody}} =
httpc:request(Method, Request, [], [{body_format, binary}], Profile),
RespHeaders2 = load_headers(RespHeaders),
{ok, {StatusCode, RespHeaders2, RespBody}}.
case httpc:request(Method, Request, [{ssl, rebar_utils:ssl_opts(URI)}],
[{body_format, binary}], Profile) of
{ok, {{_, StatusCode, _}, RespHeaders, RespBody}} ->
RespHeaders2 = load_headers(RespHeaders),
{ok, {StatusCode, RespHeaders2, RespBody}};
{error, Reason} -> {error, Reason}
end.
%%====================================================================
%% Internal functions

+ 2
- 2
src/rebar_utils.erl Vedi File

@ -1010,9 +1010,9 @@ is_list_of_strings(List) when is_list(List) ->
ssl_opts(Url) ->
case get_ssl_config() of
ssl_verify_enabled ->
ssl_opts(ssl_verify_enabled, Url);
[{versions, ['tlsv1.2']} | ssl_opts(ssl_verify_enabled, Url)];
ssl_verify_disabled ->
[{verify, verify_none}]
[{versions, ['tlsv1.2']}, {verify, verify_none}]
end.
%%------------------------------------------------------------------------------

Caricamento…
Annulla
Salva