summaryrefslogtreecommitdiff
path: root/src/rebar_pkg_resource.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/rebar_pkg_resource.erl')
-rw-r--r--src/rebar_pkg_resource.erl10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/rebar_pkg_resource.erl b/src/rebar_pkg_resource.erl
index f456587..97dc8a7 100644
--- a/src/rebar_pkg_resource.erl
+++ b/src/rebar_pkg_resource.erl
@@ -133,7 +133,7 @@ ssl_opts(Url) ->
true ->
{ok, {_, _, Hostname, _, _, _}} = http_uri:parse(ec_cnv:to_list(Url)),
VerifyFun = {fun ssl_verify_hostname:verify_fun/3, [{check_hostname, Hostname}]},
- CACerts = cacerts(),
+ CACerts = certifi:cacerts(),
[{verify, verify_peer}, {depth, 2}, {cacerts, CACerts}
,{partial_chain, fun partial_chain/1}, {verify_fun, VerifyFun}];
false ->
@@ -143,7 +143,7 @@ ssl_opts(Url) ->
partial_chain(Certs) ->
Certs1 = [{Cert, public_key:pkix_decode_cert(Cert, otp)} || Cert <- Certs],
- CACerts = cacerts(),
+ CACerts = certifi:cacerts(),
CACerts1 = [public_key:pkix_decode_cert(Cert, otp) || Cert <- CACerts],
case ec_lists:find(fun({_, Cert}) ->
@@ -158,10 +158,6 @@ partial_chain(Certs) ->
extract_public_key_info(Cert) ->
((Cert#'OTPCertificate'.tbsCertificate)#'OTPTBSCertificate'.subjectPublicKeyInfo).
-cacerts() ->
- Pems = public_key:pem_decode(rebar_cacerts:cacerts()),
- [Der || {'Certificate', Der, _} <- Pems].
-
check_cert(CACerts, Cert) ->
lists:any(fun(CACert) ->
extract_public_key_info(CACert) == extract_public_key_info(Cert)
@@ -176,7 +172,7 @@ check_ssl_version() ->
end.
parse_vsn(Vsn) ->
- version_pad(string:tokens(Vsn, ".")).
+ version_pad(string:tokens(Vsn, ".-")).
version_pad([Major]) ->
{list_to_integer(Major), 0, 0};