Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default SSL Options don't work in OTP-26+ #80

Open
tsloughter opened this issue Jun 6, 2024 · 3 comments
Open

Default SSL Options don't work in OTP-26+ #80

tsloughter opened this issue Jun 6, 2024 · 3 comments

Comments

@tsloughter
Copy link
Collaborator

See #77

Also, it'd be great if, like say Ruby's pg, we could maybe automatically enable ssl when needed.

@ghivert
Copy link

ghivert commented Jul 7, 2024

Hi!

gleam_pgo is using pgo under the hood, and I needed to have a correct SSL defaults for the package. In the end, I ended up with a configuration like:

default_ssl_options(Host, Ssl) ->
  case Ssl of
    false -> [];
    true -> [
      {verify, verify_peer},
      {cacerts, public_key:cacerts_get()},
      {server_name_indication, binary_to_list(Host)},
      {customize_hostname_check, [
        {match_fun, public_key:pkix_verify_hostname_match_fun(https)}
      ]}
    ]
  end.

Which solves the settings for SSL. Maybe this should be merged directly to the pgo package? I suppose pgo should also take care of merging the defaults settings with the user settings, or let user overrides the defaults settings?

@lpil
Copy link
Contributor

lpil commented Jul 17, 2024

That looks fab to me!

Though I must admit I'm not very familiar with configuring SSL in Erlang 😁

@ghivert
Copy link

ghivert commented Jul 17, 2024

I'm not sure @tsloughter wanted to push it in pgo. I let him confirm or infirm here 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants