Skip to content

Commit

Permalink
avoid overwriting ssl opts with url if already set in config
Browse files Browse the repository at this point in the history
  • Loading branch information
ruslandoga committed Aug 21, 2024
1 parent cba4947 commit fa9f420
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/ecto/repo/supervisor.ex
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,15 @@ defmodule Ecto.Repo.Supervisor do
case repo_init(type, repo, config) do
{:ok, config} ->
{url, config} = Keyword.pop(config, :url)
{:ok, Keyword.merge(config, parse_url(url || ""))}
url_config = parse_url(url || "")

url_config =
cond do
is_list(config[:ssl]) and url_config[:ssl] == true -> Keyword.delete(url_config, :ssl)
true -> url_config
end

{:ok, Keyword.merge(config, url_config)}

:ignore ->
:ignore
Expand Down

0 comments on commit fa9f420

Please sign in to comment.