Skip to content

Commit

Permalink
default to system certificate store
Browse files Browse the repository at this point in the history
  • Loading branch information
Greg Rychlewski authored and Greg Rychlewski committed Jun 26, 2024
1 parent cb9c213 commit f06c79b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/postgrex/protocol.ex
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,18 @@ defmodule Postgrex.Protocol do
end

defp default_ssl_opts do
[
opts = [
verify: :verify_peer,
customize_hostname_check: [
match_fun: :public_key.pkix_verify_hostname_match_fun(:https)
]
]

try do
Keyword.put(opts, :cacerts, :public_key.cacerts_get())

Check warning on line 154 in lib/postgrex/protocol.ex

View workflow job for this annotation

GitHub Actions / test (9.4, skip_wal, 1.11.4, 23.3.3)

:public_key.cacerts_get/0 is undefined or private

Check warning on line 154 in lib/postgrex/protocol.ex

View workflow job for this annotation

GitHub Actions / test (9.5, skip_wal, 1.11.4, 23.3.3)

:public_key.cacerts_get/0 is undefined or private

Check warning on line 154 in lib/postgrex/protocol.ex

View workflow job for this annotation

GitHub Actions / test (9.6, skip_wal, 1.11.4, 23.3.3)

:public_key.cacerts_get/0 is undefined or private

Check warning on line 154 in lib/postgrex/protocol.ex

View workflow job for this annotation

GitHub Actions / test (10, 1.11.4, 23.3.3)

:public_key.cacerts_get/0 is undefined or private

Check warning on line 154 in lib/postgrex/protocol.ex

View workflow job for this annotation

GitHub Actions / test (11, 1.11.4, 23.3.3)

:public_key.cacerts_get/0 is undefined or private

Check warning on line 154 in lib/postgrex/protocol.ex

View workflow job for this annotation

GitHub Actions / test (12, 1.11.4, 23.3.3)

:public_key.cacerts_get/0 is undefined or private

Check warning on line 154 in lib/postgrex/protocol.ex

View workflow job for this annotation

GitHub Actions / test (13, 1.11.4, 23.3.3)

:public_key.cacerts_get/0 is undefined or private

Check warning on line 154 in lib/postgrex/protocol.ex

View workflow job for this annotation

GitHub Actions / test (14, 1.11.4, 23.3.3)

:public_key.cacerts_get/0 is undefined or private
rescue
_ -> opts
end
end

defp endpoints(opts) do
Expand Down

0 comments on commit f06c79b

Please sign in to comment.