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

Fix SSL cert crash #50

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
elixir 1.11.3
elixir 1.14.3-otp-25
erlang 25.2.2
14 changes: 14 additions & 0 deletions lib/connection_pool.ex
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ defmodule Kadabra.ConnectionPool do
events: [any, ...]
}

require Logger

alias Kadabra.Connection

@spec start_link(URI.t(), pid, Keyword.t()) :: {:ok, pid}
Expand Down Expand Up @@ -98,6 +100,18 @@ defmodule Kadabra.ConnectionPool do
{:stop, :shutdown, state}
end

def handle_info({:EXIT, _pid, {:ssl_error, _}}, state) do
Logger.warning(
'TLS client: In state connection received SERVER ALERT: Fatal - Certificate Expired'
)

{:noreply, state}
end

def handle_info(_, state) do
{:noreply, state}
end

def terminate(_reason, _state) do
:ok
end
Expand Down
2 changes: 1 addition & 1 deletion lib/frame/continuation.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ defmodule Kadabra.Frame.Continuation do

defstruct [:header_block_fragment, :stream_id, end_headers: false]

use Bitwise
import Bitwise

@type t :: %__MODULE__{
end_headers: boolean,
Expand Down
2 changes: 1 addition & 1 deletion lib/frame/data.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ defmodule Kadabra.Frame.Data do

defstruct [:stream_id, :data, end_stream: false]

use Bitwise
import Bitwise

alias Kadabra.Frame

Expand Down
2 changes: 1 addition & 1 deletion lib/frame/headers.ex
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ defmodule Kadabra.Frame.Headers do
weight: non_neg_integer
}

use Bitwise
import Bitwise

alias Kadabra.Frame

Expand Down
2 changes: 1 addition & 1 deletion lib/frame/ping.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ defmodule Kadabra.Frame.Ping do

defstruct [:data, stream_id: 0, ack: false]

use Bitwise
import Bitwise

alias Kadabra.Frame

Expand Down
2 changes: 1 addition & 1 deletion lib/frame/push_promise.ex
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ defmodule Kadabra.Frame.PushPromise do
header_block_fragment: nil,
stream_id: nil

use Bitwise
import Bitwise

alias Kadabra.Frame

Expand Down
2 changes: 1 addition & 1 deletion lib/frame/settings.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ defmodule Kadabra.Frame.Settings do

defstruct [:settings, ack: false]

use Bitwise
import Bitwise

alias Kadabra.Connection

Expand Down