Skip to content

Commit

Permalink
Remove Application.ensure_all_started(:ssl)
Browse files Browse the repository at this point in the history
We already have `:ssl` in `:extra_applications`.
  • Loading branch information
wojtekmach committed Jul 1, 2024
1 parent 50bf21c commit 7cf8988
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion lib/tds/protocol.ex
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,23 @@ defmodule Tds.Protocol do
end

defp ssl_connect(%{sock: {:gen_tcp, sock}, opts: opts} = s) do
{:ok, _} = Application.ensure_all_started(:ssl)
{ssl_opts, opts} =

Check warning on line 426 in lib/tds/protocol.ex

View workflow job for this annotation

GitHub Actions / Unit Tests (mssql/server:2017-latest, 23.3, 1.13.4)

variable "ssl_opts" is unused (if the variable is not meant to be used, prefix it with an underscore)

Check warning on line 426 in lib/tds/protocol.ex

View workflow job for this annotation

GitHub Actions / Unit Tests (mssql/server:2022-latest, 23.3, 1.13.4)

variable "ssl_opts" is unused (if the variable is not meant to be used, prefix it with an underscore)

Check warning on line 426 in lib/tds/protocol.ex

View workflow job for this annotation

GitHub Actions / Unit Tests (azure-sql-edge:latest, 23.3, 1.13.4)

variable "ssl_opts" is unused (if the variable is not meant to be used, prefix it with an underscore)

Check warning on line 426 in lib/tds/protocol.ex

View workflow job for this annotation

GitHub Actions / Unit Tests (mssql/server:2022-latest, 24.3, 1.14.4, lint)

variable "ssl_opts" is unused (if the variable is not meant to be used, prefix it with an underscore)
case Keyword.pop(opts, :ssl, false) do
{false, opts} ->
{nil, opts}

{true, opts} ->
Logger.warning(
"setting ssl: true on your database connection offers only limited protection, " <>
"as the server's certificate is not verified. Set \"ssl: [cacertfile: \"/path/to/cacert.crt\"]\" instead"
)

# Read ssl_opts for backwards compatibility
Keyword.pop(opts, :ssl_opts, [])

{ssl_opts, opts} when is_list(ssl_opts) ->
{Keyword.merge(default_ssl_opts(), ssl_opts), opts}

Check failure on line 441 in lib/tds/protocol.ex

View workflow job for this annotation

GitHub Actions / Unit Tests (mssql/server:2017-latest, 23.3, 1.13.4)

** (CompileError) lib/tds/protocol.ex:441: undefined function default_ssl_opts/0 (expected Tds.Protocol to define such a function or for it to be imported, but none are available)

Check failure on line 441 in lib/tds/protocol.ex

View workflow job for this annotation

GitHub Actions / Unit Tests (mssql/server:2022-latest, 23.3, 1.13.4)

** (CompileError) lib/tds/protocol.ex:441: undefined function default_ssl_opts/0 (expected Tds.Protocol to define such a function or for it to be imported, but none are available)

Check failure on line 441 in lib/tds/protocol.ex

View workflow job for this annotation

GitHub Actions / Unit Tests (azure-sql-edge:latest, 23.3, 1.13.4)

** (CompileError) lib/tds/protocol.ex:441: undefined function default_ssl_opts/0 (expected Tds.Protocol to define such a function or for it to be imported, but none are available)

Check failure on line 441 in lib/tds/protocol.ex

View workflow job for this annotation

GitHub Actions / Unit Tests (mssql/server:2022-latest, 24.3, 1.14.4, lint)

** (CompileError) lib/tds/protocol.ex:441: undefined function default_ssl_opts/0 (expected Tds.Protocol to define such a function or for it to be imported, but none are available)
end

case Tds.Tls.connect(sock, opts[:ssl_opts] || []) do
{:ok, ssl_sock} ->
Expand Down

0 comments on commit 7cf8988

Please sign in to comment.