浏览代码

force use of tls1.2 for http fetching to work on OTP-23-rc1

pull/2240/head
Tristan Sloughter 5 年前
父节点
当前提交
b7cfa757dc
找不到此签名对应的密钥 GPG 密钥 ID: AAB97DDECCEB8150
共有 4 个文件被更改,包括 6 次插入5 次删除
  1. +1
    -1
      bootstrap
  2. +2
    -1
      src/r3_hex_http_httpc.erl
  3. +1
    -1
      src/r3_hex_tarball.erl
  4. +2
    -2
      src/rebar_utils.erl

+ 1
- 1
bootstrap 查看文件

@ -113,7 +113,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,

+ 2
- 1
src/r3_hex_http_httpc.erl 查看文件

@ -13,7 +13,8 @@
request(Method, URI, ReqHeaders, Body, AdapterConfig) ->
Profile = maps:get(profile, AdapterConfig, default),
Request = build_request(URI, ReqHeaders, Body),
case httpc:request(Method, Request, [], [{body_format, binary}], Profile) of
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}};

+ 1
- 1
src/r3_hex_tarball.erl 查看文件

@ -223,7 +223,7 @@ do_unpack(Files, OuterChecksum, Output) ->
finish_unpack({error, _} = Error) ->
Error;
finish_unpack(#{metadata := Metadata, files := Files, inner_checksum := InnerChecksum, outer_checksum := OuterChecksum, output := Output}) ->
_Version = maps:get("VERSION", Files),
_ = maps:get("VERSION", Files),
ContentsBinary = maps:get("contents.tar.gz", Files),
filelib:ensure_dir(filename:join(Output, "*")),
case unpack_tarball(ContentsBinary, Output) of

+ 2
- 2
src/rebar_utils.erl 查看文件

@ -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.
%%------------------------------------------------------------------------------

正在加载...
取消
保存