Skip to content

Commit d5689d1

Browse files
authored
CAStore vsn adjustment (#130)
1 parent 13a59c6 commit d5689d1

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

lib/sobelow.ex

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -541,19 +541,27 @@ defmodule Sobelow do
541541
end
542542

543543
defp get_sobelow_version() do
544-
# Modeled after old Mix.Utils.read_path
545-
# Uses CAStore since we cannot use exclusively use OTP 25+ yet
546-
{:ok, _} =
547-
Application.ensure_all_started(:ssl, verify: :verify_peer, cacertfile: CAStore.file_path())
544+
{:ok, _} = Application.ensure_all_started(:ssl)
548545

549546
{:ok, _} = Application.ensure_all_started(:inets)
550547
{:ok, _} = :inets.start(:httpc, [{:profile, :sobelow}])
551548

552549
url = 'https://sobelow.io/version'
553550

551+
# Uses CAStore since we cannot use exclusively use OTP 25+ yet
552+
cacertfile = CAStore.file_path() |> String.to_charlist()
553+
554+
http_options = [
555+
ssl: [
556+
verify: :verify_peer,
557+
cacertfile: cacertfile
558+
],
559+
timeout: 10000
560+
]
561+
554562
IO.puts(:stderr, "Checking Sobelow version...\n")
555563

556-
case :httpc.request(:get, {url, []}, [{:timeout, 10000}], []) do
564+
case :httpc.request(:get, {url, []}, http_options, []) do
557565
{:ok, {{_, 200, _}, _, vsn}} ->
558566
Version.parse!(String.trim(to_string(vsn)))
559567

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ defmodule Sobelow.Mixfile do
2929
[
3030
{:ex_doc, "~> 0.20", only: :dev},
3131
{:jason, "~> 1.0"},
32-
{:castore, "~> 1.0.0"}
32+
{:castore, ">= 0.0.0"}
3333
]
3434
end
3535

0 commit comments

Comments
 (0)