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

Base SSL-opts are incompatible with TLS v1.3 #748

Open
DerTim1 opened this issue Dec 12, 2024 · 0 comments
Open

Base SSL-opts are incompatible with TLS v1.3 #748

DerTim1 opened this issue Dec 12, 2024 · 0 comments

Comments

@DerTim1
Copy link

DerTim1 commented Dec 12, 2024

In

{secure_renegotiate, true},
two BaseOpts

{secure_renegotiate, true},
{reuse_sessions, true}

will be set. These options are incompatible with {versions, [tlsv1.3]} (see e.g. https://www.erlang.org/doc/apps/ssl/ssl.html#t:common_option_pre_tls13/0). Setting them to false won't help either.

See this example:

iex(1)> ssl_options = [
...(1)>     versions: [:"tlsv1.3"],
...(1)>     cacertfile: "/etc/ssl/certs/ca-certificates.crt",
...(1)>     verify: :verify_peer
...(1)>   ]
[
  versions: [:"tlsv1.3"],
  cacertfile: "/etc/ssl/certs/ca-certificates.crt",
  verify: :verify_peer
]
iex(2)> :hackney_ssl.connect('s3.eu-central-1.amazonaws.com', 443, ssl_options)
{:error,
 {:options, :incompatible, [:secure_renegotiate, {:versions, [:"tlsv1.3"]}]}}

When removing {secure_renegotiate, true} & {reuse_sessions, true} in hackney_ssl.erl, it will work:

iex(2)> :hackney_ssl.connect('s3.eu-central-1.amazonaws.com', 443, ssl_options)
{:ok,
 {:sslsocket, {:gen_tcp, #Port<0.37>, :tls_connection, :undefined},
  [#PID<0.1344.0>, #PID<0.1343.0>]}}

Can the options be removed? Alternative a condition need to be added on the value of versions and only add them, if it doesn't contain tlsv1.3.

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

1 participant