Skip to content

Commit d840533

Browse files
Remove deprecated :ssl.cipher_suites/0 call
The :ssl.cipher_suites/0 function is deprecated in favor of :ssl.cipher_suites/2. Since Elixir 1.11+ requires OTP 21+, we can remove the conditional code for older OTP versions and always use the newer API. This simplifies the code and fixes deprecation warnings: warning: :ssl.cipher_suites/0 is undefined or private, use cipher_suites/2,3 instead
1 parent 5f88521 commit d840533

2 files changed

Lines changed: 3 additions & 11 deletions

File tree

lib/appsignal/transmitter.ex

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,8 @@ defmodule Appsignal.Transmitter do
128128
]
129129
end
130130

131-
if System.otp_release() >= "20.3" do
132-
defp ciphers, do: :ssl.cipher_suites(:default, :"tlsv1.2")
133-
else
134-
defp ciphers, do: :ssl.cipher_suites()
135-
end
131+
# OTP 21+ is required for Elixir 1.11+, so we always use the new API
132+
defp ciphers, do: :ssl.cipher_suites(:default, :"tlsv1.2")
136133
end
137134

138135
if System.otp_release() >= "21" do

test/appsignal/transmitter_test.exs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,7 @@ defmodule Appsignal.TransmitterTest do
9797
refute Keyword.has_key?(ssl_options, :versions)
9898
assert ssl_options[:depth] == 4
9999
assert ssl_options[:honor_cipher_order] == :undefined
100-
101-
if System.otp_release() >= "20.3" do
102-
assert ssl_options[:ciphers] == :ssl.cipher_suites(:default, :"tlsv1.2")
103-
else
104-
assert ssl_options[:ciphers] == :ssl.cipher_suites()
105-
end
100+
assert ssl_options[:ciphers] == :ssl.cipher_suites(:default, :"tlsv1.2")
106101
end
107102

108103
if System.otp_release() >= "21" do

0 commit comments

Comments
 (0)