Skip to content

Commit fb919d3

Browse files
authored
improvement: pass through tls_versions to underlying adapter (#50)
allow tls_versions ("tlsv1.2", "tlsv1.3") to be set and passed through to underlying adapter - defaults to "tlsv1.2" - this is to fix middlebox compatibility mode issues.
1 parent 85e91e3 commit fb919d3

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

  • lib/ash_storage/service

lib/ash_storage/service/s3.ex

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,20 @@ if Code.ensure_loaded?(ReqS3) do
228228
resolve_credential(opts, :secret_access_key, "AWS_SECRET_ACCESS_KEY")
229229
)
230230

231+
tls_versions =
232+
Keyword.get(opts, :tls_versions, "tlsv1.2")
233+
|> String.split(",")
234+
|> Enum.reject(&(String.trim(&1) not in ["tlsv1.2", "tlsv1.3"]))
235+
|> Enum.map(&String.to_atom(String.trim(&1)))
236+
237+
transport_opts =
238+
[transport_opts: [versions: tls_versions]]
239+
231240
Req.new(
232241
base_url: "#{endpoint}/#{bucket}",
233242
aws_sigv4: sigv4_opts,
234-
retry: :transient
243+
retry: :transient,
244+
connect_options: transport_opts
235245
)
236246
end
237247

0 commit comments

Comments
 (0)