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

{:stream_error, :protocol_error, :"Stream reset by server."} #327

Open
ns-blee opened this issue Jan 9, 2024 · 5 comments
Open

{:stream_error, :protocol_error, :"Stream reset by server."} #327

ns-blee opened this issue Jan 9, 2024 · 5 comments

Comments

@ns-blee
Copy link

ns-blee commented Jan 9, 2024

:gun_error : {:stream_error, :protocol_error, :"Stream reset by server."}

Certs from GlobalSign

In Phoenix. The stream ref is created, but the somewhere before upgrade the above error presents itself. The request is never passed to &Node.Socket.init/2 Non-tls connection work fine. Please advise...

{:gun, "~> 2.0"}
{:plug_cowboy, "~> 2.5"}

server:

  defmodule Node.Server do
      use GenServer
      
      def start_link(opts) do
        GenServer.start_link(__MODULE__, opts, name: __MODULE__)
      end
      
      def init(opts) do
        routes = [
          {:_,
           [
             {"/", Node.Socket, []}
           ]}
        ]
      
        # Compile the routes into a dispatch list
        dispatch = :cowboy_router.compile(routes)
      
        {protocol, start_fn, opts} =
          case System.get_env("IS_DOCKER") do
            "true" ->
              {:https, &:cowboy.start_tls/3,
               [
                 {:port, opts.port},
                 {:cacertfile, "/app/priv/ssl/http/ca.crt"},
                 {:certfile, "/app/priv/ssl/http/server.crt"},
                 {:keyfile, "/app/priv/ssl/http/server.key"},
               ]}
      
            _ ->
              {:http, &:cowboy.start_clear/3,
               [
                 {:port, opts.port}
               ]}
          end
      
        {:ok, _} =
          start_fn.(
            protocol,
            opts,
            %{
              env: %{dispatch: dispatch}
            }
          )
      
        {:ok, %{}}
      end
      end

client:

  defp connect_to_node({admin_domain, admin_port, port} = node, token, state) do
    admin_domain = admin_domain |> String.to_charlist()

    options =
        case System.get_env("IS_DOCKER") do
        "true" ->
          %{
            transport: :tls,
            tls_opts: [
              {:port, port},
              {:verify, :verify_peer},
              {:server_name_indication, admin_domain},
              {:customize_hostname_check, [{:match_fun, :public_key.pkix_verify_hostname_match_fun(:https)}]},
              {:cacerts, :public_key.cacerts_get()}
            ]
          }

        _ ->
          %{
            tcp_opts: [{:port, port}]
          }
       end

    {:ok, conn_pid} = :gun.open(admin_domain, admin_port, options)

    Logger.debug("Attempting to connect to Admin Node @ #{admin_domain}:#{admin_port} from local port #{port}")

    case :gun.await_up(conn_pid) do
      {:ok, _} ->
        token = token || fetch_token()

        headers = %{
          "authorization" => "#{token}"
        }

        stream_ref = :gun.ws_upgrade(conn_pid, ~c"/", headers) |> IO.inspect()

        Node.Identity.set(%{
          connected_node: node
        })

        if Node.Identity.get().primary_node != node do
          :timer.send_after(900_000, self(), :connect_to_primary)
        end

        {:ok, %{state | conn_pid: conn_pid, stream_ref: stream_ref}}

      {:error, error} ->
        Logger.debug("Failed to connect to Admin Node @ #{admin_domain}:#{admin_port} from local port #{port} | Error: #{inspect(error)}")
        :gun.shutdown(conn_pid)
        {:error, state}
    end
  end
@essen
Copy link
Member

essen commented Jan 10, 2024

Please add trace: true to the Gun options (next to transport: :tls,) so we can see what it's doing.

@ns-blee
Copy link
Author

ns-blee commented Jan 10, 2024

[0m(<0.666.0>) in {gen_statem,loop_receive,3} (Timestamp: {1704,896297,785799})
(<0.666.0>) out {gen_statem,loop_receive,3} (Timestamp: {1704,896297,785823})
(<0.666.0>) in {gen_statem,loop_receive,3} (Timestamp: {1704,896297,798628})
(<0.666.0>) << {'$gen_cast',
                   {ws_upgrade,<0.651.0>,#Ref<0.2683160591.2479882242.85291>,
                       "/",
                       [{<<"authorization">>,
                         <<236,89,159,101,86,199,186,34,229,35,53,199,154,
                           173,164,103,198,212,120,108,49,209,211,114,140,
                           143,108,96,241,6,105,29,166,137,186,219,18,227,
                           156,64,70,13,10,150,199,179,118,105,160,71,120,
                           137,177,178,25,149,204,15,225,184,152,190,90,
                           156,68,33,214,114,115,101,36,55,213,49,165,46,
                           206,216,82,138,24,207,144,159,66,221,191,27,152,
                           128,101,68,136,132,60,58,164,178,35,122,192,211,
                           242,142,64,207,53,246,71,176,195,104,2,82,22,97,
                           136,27,103,157,144,113,238,16,205,232,75,61>>}]}} (Timestamp: {1704,
                                                                                          896297,
                                                                                          798634})
(<0.666.0>) call gun:connected/3 (Timestamp: {1704,896297,798648})
(<0.666.0>) call gun:connected/3 (Timestamp: {1704,896297,798653})
(<0.666.0>) call gun:dereference_stream_ref/2 (Timestamp: {1704,896297,798657})
(<0.666.0>) call gun:'-dereference_stream_ref/2-lc$^0/1-0-'/1 (Timestamp: {1704,
                                                                           896297,
                                                                           798659})
(<0.666.0>) returned from gun:'-dereference_stream_ref/2-lc$^0/1-0-'/1 -> [] (Timestamp: {1704,
                                                                                          896297,
                                                                                          798662})
(<0.666.0>) returning to gun:dereference_stream_ref/2 (Timestamp: {1704,
                                                                   896297,
                                                                   798666})
(<0.666.0>) returned from gun:dereference_stream_ref/2 -> #Ref<0.2683160591.2479882242.85291> (Timestamp: {1704,
                                                                                                           896297,
                                                                                                           798667})
(<0.666.0>) returning to gun:connected/3 (Timestamp: {1704,896297,798668})
(<0.666.0>) call gun_http2:ws_upgrade/11 (Timestamp: {1704,896297,798672})
(<0.666.0>) call gun_http2:prepare_headers/7 (Timestamp: {1704,896297,798679})
(<0.666.0>) call gun_http2:scheme/1 (Timestamp: {1704,896297,798681})
(<0.666.0>) returned from gun_http2:scheme/1 -> <<"https">> (Timestamp: {1704,
                                                                         896297,
                                                                         798683})
(<0.666.0>) returning to gun_http2:prepare_headers/7 (Timestamp: {1704,896297,
                                                                  798684})
(<0.666.0>) call gun_http:host_header/3 (Timestamp: {1704,896297,798692})
(<0.666.0>) returned from gun_http:host_header/3 -> ["admin.ccoud.net",
                                                     58,<<"4575">>] (Timestamp: {1704,
                                                                                 896297,
                                                                                 798694})
(<0.666.0>) returning to gun_http2:prepare_headers/7 (Timestamp: {1704,896297,
                                                                  798698})
(<0.666.0>) code_server ! {code_call,<0.666.0>,
                              {get_object_code_for_loading,gun_cookies}} (Timestamp: {1704,
                                                                                      896297,
                                                                                      798708})
(<0.666.0>) out {code_server,call,1} (Timestamp: {1704,896297,798713})
(<0.666.0>) in {code_server,call,1} (Timestamp: {1704,896297,802191})
(<0.666.0>) << {code_server,
                   {gun_cookies,
                       <<REMOVED>>,
                       "/app/_build/dev/lib/gun/ebin/gun_cookies.beam",
                       #Ref<0.2683160591.2479882246.85830>}} (Timestamp: {1704,
                                                                          896297,
                                                                          802195})
(<0.666.0>) code_server ! {code_call,<0.666.0>,
                              {load_module,
                                  #Ref<0.2683160591.2480013317.86452>,
                                  gun_cookies,
                                  "/app/_build/dev/lib/gun/ebin/gun_cookies.beam",
                                  false,#Ref<0.2683160591.2479882246.85830>}} (Timestamp: {1704,
                                                                                           896297,
                                                                                           802877})
(<0.666.0>) out {code_server,call,1} (Timestamp: {1704,896297,802883})
(<0.666.0>) in {code_server,call,1} (Timestamp: {1704,896297,810897})
(<0.666.0>) << {code_server,{module,gun_cookies}} (Timestamp: {1704,896297,
                                                               810904})
(<0.666.0>) returned from gun_http2:prepare_headers/7 -> {ok,
                                                          #{scheme =>
                                                             <<"https">>,
                                                            path => "/",
                                                            authority =>
                                                             ["admin.ccoud.net",
                                                              58,<<"4575">>],
                                                            method =>
                                                             <<"CONNECT">>},
                                                          [{<<"authorization">>,
                                                            <<236,89,159,101,
                                                              86,199,186,34,
                                                              229,35,53,199,
                                                              154,173,164,
                                                              103,198,212,
                                                              120,108,49,209,
                                                              211,114,140,
                                                              143,108,96,241,
                                                              6,105,29,166,
                                                              137,186,219,18,
                                                              227,156,64,70,
                                                              13,10,150,199,
                                                              179,118,105,
                                                              160,71,120,137,
                                                              177,178,25,149,
                                                              204,15,225,184,
                                                              152,190,90,156,
                                                              68,33,214,114,
                                                              115,101,36,55,
                                                              213,49,165,46,
                                                              206,216,82,138,
                                                              24,207,144,159,
                                                              66,221,191,27,
                                                              152,128,101,68,
                                                              136,132,60,58,
                                                              164,178,35,122,
                                                              192,211,242,
                                                              142,64,207,53,
                                                              246,71,176,195,
                                                              104,2,82,22,97,
                                                              136,27,103,157,
                                                              144,113,238,16,
                                                              205,232,75,61>>}],
                                                          undefined} (Timestamp: {1704,
                                                                                  896297,
                                                                                  810915})
(<0.666.0>) returning to gun_http2:ws_upgrade/11 (Timestamp: {1704,896297,
                                                              810922})
(<0.666.0>) call gun_http2:stream_ref/2 (Timestamp: {1704,896297,810930})
(<0.666.0>) returned from gun_http2:stream_ref/2 -> #Ref<0.2683160591.2479882242.85291> (Timestamp: {1704,
                                                                                                     896297,
                                                                                                     810932})
(<0.666.0>) returning to gun_http2:ws_upgrade/11 (Timestamp: {1704,896297,
                                                              810934})
(<0.666.0>) gc_minor_start [{wordsize,0},
 {old_heap_block_size,2586},
 {heap_block_size,1598},
 {mbuf_size,34},
 {recent_size,153},
 {stack_size,59},
 {old_heap_size,333},
 {heap_size,1535},
 {bin_vheap_size,32983},
 {bin_vheap_block_size,46422},
 {bin_old_vheap_size,0},
 {bin_old_vheap_block_size,46422}] (Timestamp: {1704,896297,810958})
(<0.666.0>) gc_minor_end [{wordsize,1338},
 {old_heap_block_size,2586},
 {heap_block_size,2586},
 {mbuf_size,0},
 {recent_size,200},
 {stack_size,59},
 {old_heap_size,364},
 {heap_size,200},
 {bin_vheap_size,16},
 {bin_vheap_block_size,46422},
 {bin_old_vheap_size,0},
 {bin_old_vheap_block_size,46422}] (Timestamp: {1704,896297,810981})
(<0.666.0>) <0.671.0> ! {'$gen_call',
                            {<0.666.0>,#Ref<0.2683160591.2479882245.86519>},
                            {application_data,
                                [<<REMOVED>>]}} (Timestamp: {1704,896297,
                                                                811053})
(<0.666.0>) out {gen,do_call,4} (Timestamp: {1704,896297,811058})
(<0.666.0>) in {gen,do_call,4} (Timestamp: {1704,896297,811288})
(<0.666.0>) << {#Ref<0.2683160591.2479882245.86519>,ok} (Timestamp: {1704,
                                                                     896297,
                                                                     811291})
(<0.666.0>) call gun_http2:create_stream/2 (Timestamp: {1704,896297,811298})
(<0.666.0>) returned from gun_http2:create_stream/2 -> {http2_state,
                                                        <0.651.0>,
                                                        {sslsocket,
                                                         {gen_tcp,
                                                          #Port<0.22>,
                                                          tls_connection,
                                                          undefined},
                                                         [<0.672.0>,
                                                          <0.671.0>]},
                                                        gun_tls,
                                                        #{initial_connection_window_size =>
                                                           8000000,
                                                          initial_stream_window_size =>
                                                           8000000},
                                                        [gun_data_h],
                                                        <<>>,undefined,
                                                        undefined,connected,
                                                        {http2_machine,
                                                         client,
                                                         #{initial_connection_window_size =>
                                                            8000000,
                                                           initial_stream_window_size =>
                                                            8000000,
                                                           message_tag =>
                                                            undefined},
                                                         normal,undefined,
                                                         undefined,
                                                         #{initial_window_size =>
                                                            8000000},
                                                         #{},
                                                         #{initial_window_size =>
                                                            65535},
                                                         65535,8000000,3,0,
                                                         2147483647,
                                                         #{1 =>
                                                            {stream,1,
                                                             <<"CONNECT">>,
                                                             nofin,65535,
                                                             {[],[]},
                                                             0,undefined,idle,
                                                             8000000,
                                                             undefined,0,
                                                             undefined}},
                                                         [],[],
                                                         {state,0,4096,4096,
                                                          []},
                                                         {state,433,4096,
                                                          4096,
                                                          [{173,
                                                            {<<"authorization">>,
                                                             <<236,89,159,
                                                               101,86,199,
                                                               186,34,229,35,
                                                               53,199,154,
                                                               173,164,103,
                                                               198,212,120,
                                                               108,49,209,
                                                               211,114,140,
                                                               143,108,96,
                                                               241,6,105,29,
                                                               166,137,186,
                                                               219,18,227,
                                                               156,64,70,13,
                                                               10,150,199,
                                                               179,118,105,
                                                               160,71,120,
                                                               137,177,178,
                                                               25,149,204,15,
                                                               225,184,152,
                                                               190,90,156,68,
                                                               33,214,114,
                                                               115,101,36,55,
                                                               213,49,165,46,
                                                               206,216,82,
                                                               138,24,207,
                                                               144,159,66,
                                                               221,191,27,
                                                               152,128,101,
                                                               68,136,132,60,
                                                               58,164,178,35,
                                                               122,192,211,
                                                               242,142,64,
                                                               207,53,246,71,
                                                               176,195,104,2,
                                                               82,22,97,136,
                                                               27,103,157,
                                                               144,113,238,
                                                               16,205,232,75,
                                                               61>>}},
                                                           {55,
                                                            {<<"sec-websocket-version">>,
                                                             <<"13">>}},
                                                           {50,
                                                            {<<":protocol">>,
                                                             <<"websocket">>}},
                                                           {109,
                                                            {<<":authority">>,
                                                             <<"admin.ccoud.net:4575">>}},
                                                           {46,
                                                            {<<":method">>,
                                                             <<"CONNECT">>}}]}},
                                                        #{1 =>
                                                           {stream,1,
                                                            #Ref<0.2683160591.2479882242.85291>,
                                                            <0.651.0>,
                                                            infinity,
                                                            ["admin.ccoud.net",
                                                             58,<<"4575">>],
                                                            "/",undefined,
                                                            {tunnel,
                                                             requested,
                                                             undefined,
                                                             {websocket_info,
                                                              [],#{}},
                                                             undefined,
                                                             undefined}}},
                                                        #{#Ref<0.2683160591.2479882242.85291> =>
                                                           1},
                                                        0} (Timestamp: {1704,
                                                                        896297,
                                                                        811300})
(<0.666.0>) returning to gun_http2:ws_upgrade/11 (Timestamp: {1704,896297,
                                                              811308})
(<0.666.0>) returned from gun_http2:ws_upgrade/11 -> {{state,
                                                       {http2_state,
                                                        <0.651.0>,
                                                        {sslsocket,
                                                         {gen_tcp,
                                                          #Port<0.22>,
                                                          tls_connection,
                                                          undefined},
                                                         [<0.672.0>,
                                                          <0.671.0>]},
                                                        gun_tls,
                                                        #{initial_connection_window_size =>
                                                           8000000,
                                                          initial_stream_window_size =>
                                                           8000000},
                                                        [gun_data_h],
                                                        <<>>,undefined,
                                                        undefined,connected,
                                                        {http2_machine,
                                                         client,
                                                         #{initial_connection_window_size =>
                                                            8000000,
                                                           initial_stream_window_size =>
                                                            8000000,
                                                           message_tag =>
                                                            undefined},
                                                         normal,undefined,
                                                         undefined,
                                                         #{initial_window_size =>
                                                            8000000},
                                                         #{},
                                                         #{initial_window_size =>
                                                            65535},
                                                         65535,8000000,3,0,
                                                         2147483647,
                                                         #{1 =>
                                                            {stream,1,
                                                             <<"CONNECT">>,
                                                             nofin,65535,
                                                             {[],[]},
                                                             0,undefined,idle,
                                                             8000000,
                                                             undefined,0,
                                                             undefined}},
                                                         [],[],
                                                         {state,0,4096,4096,
                                                          []},
                                                         {state,433,4096,
                                                          4096,
                                                          [{173,
                                                            {<<"authorization">>,
                                                             <<236,89,159,
                                                               101,86,199,
                                                               186,34,229,35,
                                                               53,199,154,
                                                               173,164,103,
                                                               198,212,120,
                                                               108,49,209,
                                                               211,114,140,
                                                               143,108,96,
                                                               241,6,105,29,
                                                               166,137,186,
                                                               219,18,227,
                                                               156,64,70,13,
                                                               10,150,199,
                                                               179,118,105,
                                                               160,71,120,
                                                               137,177,178,
                                                               25,149,204,15,
                                                               225,184,152,
                                                               190,90,156,68,
                                                               33,214,114,
                                                               115,101,36,55,
                                                               213,49,165,46,
                                                               206,216,82,
                                                               138,24,207,
                                                               144,159,66,
                                                               221,191,27,
                                                               152,128,101,
                                                               68,136,132,60,
                                                               58,164,178,35,
                                                               122,192,211,
                                                               242,142,64,
                                                               207,53,246,71,
                                                               176,195,104,2,
                                                               82,22,97,136,
                                                               27,103,157,
                                                               144,113,238,
                                                               16,205,232,75,
                                                               61>>}},
                                                           {55,
                                                            {<<"sec-websocket-version">>,
                                                             <<"13">>}},
                                                           {50,
                                                            {<<":protocol">>,
                                                             <<"websocket">>}},
                                                           {109,
                                                            {<<":authority">>,
                                                             <<"admin.ccoud.net:4575">>}},
                                                           {46,
                                                            {<<":method">>,
                                                             <<"CONNECT">>}}]}},
                                                        #{1 =>
                                                           {stream,1,
                                                            #Ref<0.2683160591.2479882242.85291>,
                                                            <0.651.0>,
                                                            infinity,
                                                            ["admin.ccoud.net",
                                                             58,<<"4575">>],
                                                            "/",undefined,
                                                            {tunnel,
                                                             requested,
                                                             undefined,
                                                             {websocket_info,
                                                              [],#{}},
                                                             undefined,
                                                             undefined}}},
                                                        #{#Ref<0.2683160591.2479882242.85291> =>
                                                           1},
                                                        0}},
                                                      undefined,undefined} (Timestamp: {1704,
                                                                                        896297,
                                                                                        811309})
(<0.666.0>) returning to gun:connected/3 (Timestamp: {1704,896297,811314})
(<0.666.0>) call gun:commands/2 (Timestamp: {1704,896297,811318})
(<0.666.0>) call gun:commands/2 (Timestamp: {1704,896297,811320})
(<0.666.0>) call gun:commands/2 (Timestamp: {1704,896297,811321})
(<0.666.0>) returned from gun:commands/2 -> {keep_state,
                                             {state,<0.651.0>,
                                              {up,
                                               #Ref<0.2683160591.2479882245.86377>},
                                              "admin.ccoud.net",
                                              4575,<<"https">>,
                                              "admin.ccoud.net",
                                              4575,[],
                                              #{trace => true,
                                                transport => tls,
                                                tls_opts =>
                                                 [{port,4576},
                                                  {verify,verify_peer},
                                                  {server_name_indication,
                                                   "admin.ccoud.net"},
                                                  {customize_hostname_check,
                                                   [{match_fun,
                                                     #Fun<public_key.6.117093159>}]},
                                                  {cacertfile,
                                                   <<"/app/priv/ssl/http/ca.crt">>}]},
                                              undefined,
                                              {sslsocket,
                                               {gen_tcp,#Port<0.22>,
                                                tls_connection,undefined},
                                               [<0.672.0>,<0.671.0>]},
                                              gun_tls,true,
                                              {ssl,ssl_closed,ssl_error},
                                              gun_http2,
                                              {http2_state,<0.651.0>,
                                               {sslsocket,
                                                {gen_tcp,#Port<0.22>,
                                                 tls_connection,undefined},
                                                [<0.672.0>,<0.671.0>]},
                                               gun_tls,
                                               #{initial_connection_window_size =>
                                                  8000000,
                                                 initial_stream_window_size =>
                                                  8000000},
                                               [gun_data_h],
                                               <<>>,undefined,undefined,
                                               connected,
                                               {http2_machine,client,
                                                #{initial_connection_window_size =>
                                                   8000000,
                                                  initial_stream_window_size =>
                                                   8000000,
                                                  message_tag => undefined},
                                                normal,undefined,undefined,
                                                #{initial_window_size =>
                                                   8000000},
                                                #{},
                                                #{initial_window_size =>
                                                   65535},
                                                65535,8000000,3,0,2147483647,
                                                #{1 =>
                                                   {stream,1,<<"CONNECT">>,
                                                    nofin,65535,
                                                    {[],[]},
                                                    0,undefined,idle,8000000,
                                                    undefined,0,undefined}},
                                                [],[],
                                                {state,0,4096,4096,[]},
                                                {state,433,4096,4096,
                                                 [{173,
                                                   {<<"authorization">>,
                                                    <<236,89,159,101,86,199,
                                                      186,34,229,35,53,199,
                                                      154,173,164,103,198,
                                                      212,120,108,49,209,211,
                                                      114,140,143,108,96,241,
                                                      6,105,29,166,137,186,
                                                      219,18,227,156,64,70,
                                                      13,10,150,199,179,118,
                                                      105,160,71,120,137,177,
                                                      178,25,149,204,15,225,
                                                      184,152,190,90,156,68,
                                                      33,214,114,115,101,36,
                                                      55,213,49,165,46,206,
                                                      216,82,138,24,207,144,
                                                      159,66,221,191,27,152,
                                                      128,101,68,136,132,60,
                                                      58,164,178,35,122,192,
                                                      211,242,142,64,207,53,
                                                      246,71,176,195,104,2,
                                                      82,22,97,136,27,103,
                                                      157,144,113,238,16,205,
                                                      232,75,61>>}},
                                                  {55,
                                                   {<<"sec-websocket-version">>,
                                                    <<"13">>}},
                                                  {50,
                                                   {<<":protocol">>,
                                                    <<"websocket">>}},
                                                  {109,
                                                   {<<":authority">>,
                                                    <<"admin.ccoud.net:4575">>}},
                                                  {46,
                                                   {<<":method">>,
                                                    <<"CONNECT">>}}]}},
                                               #{1 =>
                                                  {stream,1,
                                                   #Ref<0.2683160591.2479882242.85291>,
                                                   <0.651.0>,infinity,
                                                   ["admin.ccoud.net",
                                                    58,<<"4575">>],
                                                   "/",undefined,
                                                   {tunnel,requested,
                                                    undefined,
                                                    {websocket_info,[],#{}},
                                                    undefined,undefined}}},
                                               #{#Ref<0.2683160591.2479882242.85291> =>
                                                  1},
                                               0},
                                              undefined,gun_default_event_h,
                                              undefined}} (Timestamp: {1704,
                                                                       896297,
                                                                       811323})
(<0.666.0>) returned from gun:commands/2 -> {keep_state,
                                             {state,<0.651.0>,
                                              {up,
                                               #Ref<0.2683160591.2479882245.86377>},
                                              "admin.ccoud.net",
                                              4575,<<"https">>,
                                              "admin.ccoud.net",
                                              4575,[],
                                              #{trace => true,
                                                transport => tls,
                                                tls_opts =>
                                                 [{port,4576},
                                                  {verify,verify_peer},
                                                  {server_name_indication,
                                                   "admin.ccoud.net"},
                                                  {customize_hostname_check,
                                                   [{match_fun,
                                                     #Fun<public_key.6.117093159>}]},
                                                  {cacertfile,
                                                   <<"/app/priv/ssl/http/ca.crt">>}]},
                                              undefined,
                                              {sslsocket,
                                               {gen_tcp,#Port<0.22>,
                                                tls_connection,undefined},
                                               [<0.672.0>,<0.671.0>]},
                                              gun_tls,true,
                                              {ssl,ssl_closed,ssl_error},
                                              gun_http2,
                                              {http2_state,<0.651.0>,
                                               {sslsocket,
                                                {gen_tcp,#Port<0.22>,
                                                 tls_connection,undefined},
                                                [<0.672.0>,<0.671.0>]},
                                               gun_tls,
                                               #{initial_connection_window_size =>
                                                  8000000,
                                                 initial_stream_window_size =>
                                                  8000000},
                                               [gun_data_h],
                                               <<>>,undefined,undefined,
                                               connected,
                                               {http2_machine,client,
                                                #{initial_connection_window_size =>
                                                   8000000,
                                                  initial_stream_window_size =>
                                                   8000000,
                                                  message_tag => undefined},
                                                normal,undefined,undefined,
                                                #{initial_window_size =>
                                                   8000000},
                                                #{},
                                                #{initial_window_size =>
                                                   65535},
                                                65535,8000000,3,0,2147483647,
                                                #{1 =>
                                                   {stream,1,<<"CONNECT">>,
                                                    nofin,65535,
                                                    {[],[]},
                                                    0,undefined,idle,8000000,
                                                    undefined,0,undefined}},
                                                [],[],
                                                {state,0,4096,4096,[]},
                                                {state,433,4096,4096,
                                                 [{173,
                                                   {<<"authorization">>,
                                                    <<236,89,159,101,86,199,
                                                      186,34,229,35,53,199,
                                                      154,173,164,103,198,
                                                      212,120,108,49,209,211,
                                                      114,140,143,108,96,241,
                                                      6,105,29,166,137,186,
                                                      219,18,227,156,64,70,
                                                      13,10,150,199,179,118,
                                                      105,160,71,120,137,177,
                                                      178,25,149,204,15,225,
                                                      184,152,190,90,156,68,
                                                      33,214,114,115,101,36,
                                                      55,213,49,165,46,206,
                                                      216,82,138,24,207,144,
                                                      159,66,221,191,27,152,
                                                      128,101,68,136,132,60,
                                                      58,164,178,35,122,192,
                                                      211,242,142,64,207,53,
                                                      246,71,176,195,104,2,
                                                      82,22,97,136,27,103,
                                                      157,144,113,238,16,205,
                                                      232,75,61>>}},
                                                  {55,
                                                   {<<"sec-websocket-version">>,
                                                    <<"13">>}},
                                                  {50,
                                                   {<<":protocol">>,
                                                    <<"websocket">>}},
                                                  {109,
                                                   {<<":authority">>,
                                                    <<"admin.ccoud.net:4575">>}},
                                                  {46,
                                                   {<<":method">>,
                                                    <<"CONNECT">>}}]}},
                                               #{1 =>
                                                  {stream,1,
                                                   #Ref<0.2683160591.2479882242.85291>,
                                                   <0.651.0>,infinity,
                                                   ["admin.ccoud.net",
                                                    58,<<"4575">>],
                                                   "/",undefined,
                                                   {tunnel,requested,
                                                    undefined,
                                                    {websocket_info,[],#{}},
                                                    undefined,undefined}}},
                                               #{#Ref<0.2683160591.2479882242.85291> =>
                                                  1},
                                               0},
                                              undefined,gun_default_event_h,
                                              undefined}} (Timestamp: {1704,
                                                                       896297,
                                                                       811330})
(<0.666.0>) returned from gun:commands/2 -> {keep_state,
                                             {state,<0.651.0>,
                                              {up,
                                               #Ref<0.2683160591.2479882245.86377>},
                                              "admin.ccoud.net",
                                              4575,<<"https">>,
                                              "admin.ccoud.net",
                                              4575,[],
                                              #{trace => true,
                                                transport => tls,
                                                tls_opts =>
                                                 [{port,4576},
                                                  {verify,verify_peer},
                                                  {server_name_indication,
                                                   "admin.ccoud.net"},
                                                  {customize_hostname_check,
                                                   [{match_fun,
                                                     #Fun<public_key.6.117093159>}]},
                                                  {cacertfile,
                                                   <<"/app/priv/ssl/http/ca.crt">>}]},
                                              undefined,
                                              {sslsocket,
                                               {gen_tcp,#Port<0.22>,
                                                tls_connection,undefined},
                                               [<0.672.0>,<0.671.0>]},
                                              gun_tls,true,
                                              {ssl,ssl_closed,ssl_error},
                                              gun_http2,
                                              {http2_state,<0.651.0>,
                                               {sslsocket,
                                                {gen_tcp,#Port<0.22>,
                                                 tls_connection,undefined},
                                                [<0.672.0>,<0.671.0>]},
                                               gun_tls,
                                               #{initial_connection_window_size =>
                                                  8000000,
                                                 initial_stream_window_size =>
                                                  8000000},
                                               [gun_data_h],
                                               <<>>,undefined,undefined,
                                               connected,
                                               {http2_machine,client,
                                                #{initial_connection_window_size =>
                                                   8000000,
                                                  initial_stream_window_size =>
                                                   8000000,
                                                  message_tag => undefined},
                                                normal,undefined,undefined,
                                                #{initial_window_size =>
                                                   8000000},
                                                #{},
                                                #{initial_window_size =>
                                                   65535},
                                                65535,8000000,3,0,2147483647,
                                                #{1 =>
                                                   {stream,1,<<"CONNECT">>,
                                                    nofin,65535,
                                                    {[],[]},
                                                    0,undefined,idle,8000000,
                                                    undefined,0,undefined}},
                                                [],[],
                                                {state,0,4096,4096,[]},
                                                {state,433,4096,4096,
                                                 [{173,
                                                   {<<"authorization">>,
                                                    <<236,89,159,101,86,199,
                                                      186,34,229,35,53,199,
                                                      154,173,164,103,198,
                                                      212,120,108,49,209,211,
                                                      114,140,143,108,96,241,
                                                      6,105,29,166,137,186,
                                                      219,18,227,156,64,70,
                                                      13,10,150,199,179,118,
                                                      105,160,71,120,137,177,
                                                      178,25,149,204,15,225,
                                                      184,152,190,90,156,68,
                                                      33,214,114,115,101,36,
                                                      55,213,49,165,46,206,
                                                      216,82,138,24,207,144,
                                                      159,66,221,191,27,152,
                                                      128,101,68,136,132,60,
                                                      58,164,178,35,122,192,
                                                      211,242,142,64,207,53,
                                                      246,71,176,195,104,2,
                                                      82,22,97,136,27,103,
                                                      157,144,113,238,16,205,
                                                      232,75,61>>}},
                                                  {55,
                                                   {<<"sec-websocket-version">>,
                                                    <<"13">>}},
                                                  {50,
                                                   {<<":protocol">>,
                                                    <<"websocket">>}},
                                                  {109,
                                                   {<<":authority">>,
                                                    <<"admin.ccoud.net:4575">>}},
                                                  {46,
                                                   {<<":method">>,
                                                    <<"CONNECT">>}}]}},
                                               #{1 =>
                                                  {stream,1,
                                                   #Ref<0.2683160591.2479882242.85291>,
                                                   <0.651.0>,infinity,
                                                   ["admin.ccoud.net",
                                                    58,<<"4575">>],
                                                   "/",undefined,
                                                   {tunnel,requested,
                                                    undefined,
                                                    {websocket_info,[],#{}},
                                                    undefined,undefined}}},
                                               #{#Ref<0.2683160591.2479882242.85291> =>
                                                  1},
                                               0},
                                              undefined,gun_default_event_h,
                                              undefined}} (Timestamp: {1704,
                                                                       896297,
                                                                       811335})
(<0.666.0>) returned from gun:connected/3 -> {keep_state,
                                              {state,<0.651.0>,
                                               {up,
                                                #Ref<0.2683160591.2479882245.86377>},
                                               "admin.ccoud.net",
                                               4575,<<"https">>,
                                               "admin.ccoud.net",
                                               4575,[],
                                               #{trace => true,
                                                 transport => tls,
                                                 tls_opts =>
                                                  [{port,4576},
                                                   {verify,verify_peer},
                                                   {server_name_indication,
                                                    "admin.ccoud.net"},
                                                   {customize_hostname_check,
                                                    [{match_fun,
                                                      #Fun<public_key.6.117093159>}]},
                                                   {cacertfile,
                                                    <<"/app/priv/ssl/http/ca.crt">>}]},
                                               undefined,
                                               {sslsocket,
                                                {gen_tcp,#Port<0.22>,
                                                 tls_connection,undefined},
                                                [<0.672.0>,<0.671.0>]},
                                               gun_tls,true,
                                               {ssl,ssl_closed,ssl_error},
                                               gun_http2,
                                               {http2_state,<0.651.0>,
                                                {sslsocket,
                                                 {gen_tcp,#Port<0.22>,
                                                  tls_connection,undefined},
                                                 [<0.672.0>,<0.671.0>]},
                                                gun_tls,
                                                #{initial_connection_window_size =>
                                                   8000000,
                                                  initial_stream_window_size =>
                                                   8000000},
                                                [gun_data_h],
                                                <<>>,undefined,undefined,
                                                connected,
                                                {http2_machine,client,
                                                 #{initial_connection_window_size =>
                                                    8000000,
                                                   initial_stream_window_size =>
                                                    8000000,
                                                   message_tag => undefined},
                                                 normal,undefined,undefined,
                                                 #{initial_window_size =>
                                                    8000000},
                                                 #{},
                                                 #{initial_window_size =>
                                                    65535},
                                                 65535,8000000,3,0,2147483647,
                                                 #{1 =>
                                                    {stream,1,<<"CONNECT">>,
                                                     nofin,65535,
                                                     {[],[]},
                                                     0,undefined,idle,8000000,
                                                     undefined,0,undefined}},
                                                 [],[],
                                                 {state,0,4096,4096,[]},
                                                 {state,433,4096,4096,
                                                  [{173,
                                                    {<<"authorization">>,
                                                     <<236,89,159,101,86,199,
                                                       186,34,229,35,53,199,
                                                       154,173,164,103,198,
                                                       212,120,108,49,209,
                                                       211,114,140,143,108,
                                                       96,241,6,105,29,166,
                                                       137,186,219,18,227,
                                                       156,64,70,13,10,150,
                                                       199,179,118,105,160,
                                                       71,120,137,177,178,25,
                                                       149,204,15,225,184,
                                                       152,190,90,156,68,33,
                                                       214,114,115,101,36,55,
                                                       213,49,165,46,206,216,
                                                       82,138,24,207,144,159,
                                                       66,221,191,27,152,128,
                                                       101,68,136,132,60,58,
                                                       164,178,35,122,192,
                                                       211,242,142,64,207,53,
                                                       246,71,176,195,104,2,
                                                       82,22,97,136,27,103,
                                                       157,144,113,238,16,
                                                       205,232,75,61>>}},
                                                   {55,
                                                    {<<"sec-websocket-version">>,
                                                     <<"13">>}},
                                                   {50,
                                                    {<<":protocol">>,
                                                     <<"websocket">>}},
                                                   {109,
                                                    {<<":authority">>,
                                                     <<"admin.ccoud.net:4575">>}},
                                                   {46,
                                                    {<<":method">>,
                                                     <<"CONNECT">>}}]}},
                                                #{1 =>
                                                   {stream,1,
                                                    #Ref<0.2683160591.2479882242.85291>,
                                                    <0.651.0>,infinity,
                                                    ["admin.ccoud.net",
                                                     58,<<"4575">>],
                                                    "/",undefined,
                                                    {tunnel,requested,
                                                     undefined,
                                                     {websocket_info,[],#{}},
                                                     undefined,undefined}}},
                                                #{#Ref<0.2683160591.2479882242.85291> =>
                                                   1},
                                                0},
                                               undefined,gun_default_event_h,
                                               undefined}} (Timestamp: {1704,
                                                                        896297,
                                                                        811340})
(<0.666.0>) returned from gun:connected/3 -> {keep_state,
                                              {state,<0.651.0>,
                                               {up,
                                                #Ref<0.2683160591.2479882245.86377>},
                                               "admin.ccoud.net",
                                               4575,<<"https">>,
                                               "admin.ccoud.net",
                                               4575,[],
                                               #{trace => true,
                                                 transport => tls,
                                                 tls_opts =>
                                                  [{port,4576},
                                                   {verify,verify_peer},
                                                   {server_name_indication,
                                                    "admin.ccoud.net"},
                                                   {customize_hostname_check,
                                                    [{match_fun,
                                                      #Fun<public_key.6.117093159>}]},
                                                   {cacertfile,
                                                    <<"/app/priv/ssl/http/ca.crt">>}]},
                                               undefined,
                                               {sslsocket,
                                                {gen_tcp,#Port<0.22>,
                                                 tls_connection,undefined},
                                                [<0.672.0>,<0.671.0>]},
                                               gun_tls,true,
                                               {ssl,ssl_closed,ssl_error},
                                               gun_http2,
                                               {http2_state,<0.651.0>,
                                                {sslsocket,
                                                 {gen_tcp,#Port<0.22>,
                                                  tls_connection,undefined},
                                                 [<0.672.0>,<0.671.0>]},
                                                gun_tls,
                                                #{initial_connection_window_size =>
                                                   8000000,
                                                  initial_stream_window_size =>
                                                   8000000},
                                                [gun_data_h],
                                                <<>>,undefined,undefined,
                                                connected,
                                                {http2_machine,client,
                                                 #{initial_connection_window_size =>
                                                    8000000,
                                                   initial_stream_window_size =>
                                                    8000000,
                                                   message_tag => undefined},
                                                 normal,undefined,undefined,
                                                 #{initial_window_size =>
                                                    8000000},
                                                 #{},
                                                 #{initial_window_size =>
                                                    65535},
                                                 65535,8000000,3,0,2147483647,
                                                 #{1 =>
                                                    {stream,1,<<"CONNECT">>,
                                                     nofin,65535,
                                                     {[],[]},
                                                     0,undefined,idle,8000000,
                                                     undefined,0,undefined}},
                                                 [],[],
                                                 {state,0,4096,4096,[]},
                                                 {state,433,4096,4096,
                                                  [{173,
                                                    {<<"authorization">>,
                                                     <<236,89,159,101,86,199,
                                                       186,34,229,35,53,199,
                                                       154,173,164,103,198,
                                                       212,120,108,49,209,
                                                       211,114,140,143,108,
                                                       96,241,6,105,29,166,
                                                       137,186,219,18,227,
                                                       156,64,70,13,10,150,
                                                       199,179,118,105,160,
                                                       71,120,137,177,178,25,
                                                       149,204,15,225,184,
                                                       152,190,90,156,68,33,
                                                       214,114,115,101,36,55,
                                                       213,49,165,46,206,216,
                                                       82,138,24,207,144,159,
                                                       66,221,191,27,152,128,
                                                       101,68,136,132,60,58,
                                                       164,178,35,122,192,
                                                       211,242,142,64,207,53,
                                                       246,71,176,195,104,2,
                                                       82,22,97,136,27,103,
                                                       157,144,113,238,16,
                                                       205,232,75,61>>}},
                                                   {55,
                                                    {<<"sec-websocket-version">>,
                                                     <<"13">>}},
                                                   {50,
                                                    {<<":protocol">>,
                                                     <<"websocket">>}},
                                                   {109,
                                                    {<<":authority">>,
                                                     <<"admin.ccoud.net:4575">>}},
                                                   {46,
                                                    {<<":method">>,
                                                     <<"CONNECT">>}}]}},
                                                #{1 =>
                                                   {stream,1,
                                                    #Ref<0.2683160591.2479882242.85291>,
                                                    <0.651.0>,infinity,
                                                    ["admin.ccoud.net",
                                                     58,<<"4575">>],
                                                    "/",undefined,
                                                    {tunnel,requested,
                                                     undefined,
                                                     {websocket_info,[],#{}},
                                                     undefined,undefined}}},
                                                #{#Ref<0.2683160591.2479882242.85291> =>
                                                   1},
                                                0},
                                               undefined,gun_default_event_h,
                                               undefined}} (Timestamp: {1704,
                                                                        896297,
                                                                        811346})
(<0.666.0>) returning to gen_statem:loop_state_callback/11 (Timestamp: {1704,
                                                                        896297,
                                                                        811351})
(<0.666.0>) out {gen_statem,loop_receive,3} (Timestamp: {1704,896297,811354})
(<0.666.0>) in {gen_statem,loop_receive,3} (Timestamp: {1704,896297,813209})
(<0.666.0>) << {ssl,{sslsocket,{gen_tcp,#Port<0.22>,tls_connection,undefined},
                               [<0.672.0>,<0.671.0>]},
                    <<0,0,4,3,0,0,0,0,1,0,0,0,1>>} (Timestamp: {1704,896297,
                                                                813212})
(<0.666.0>) call gun:connected/3 (Timestamp: {1704,896297,813217})
(<0.666.0>) call gun:handle_common_connected/4 (Timestamp: {1704,896297,
                                                            813219})
(<0.666.0>) call gun:handle_common_connected_no_input/4 (Timestamp: {1704,
                                                                     896297,
                                                                     813220})
(<0.666.0>) call gun_http2:handle/5 (Timestamp: {1704,896297,813223})
(<0.666.0>) call gun_http2:parse/5 (Timestamp: {1704,896297,813225})
(<0.666.0>) call gun_http2:frame/5 (Timestamp: {1704,896297,813231})
(<0.666.0>) call gun_http2:rst_stream_frame/5 (Timestamp: {1704,896297,813236})
(<0.666.0>) call gun_http2:take_stream/2 (Timestamp: {1704,896297,813240})
(<0.666.0>) returned from gun_http2:take_stream/2 -> {{stream,1,
                                                       #Ref<0.2683160591.2479882242.85291>,
                                                       <0.651.0>,infinity,
                                                       ["admin.ccoud.net",
                                                        58,<<"4575">>],
                                                       "/",undefined,
                                                       {tunnel,requested,
                                                        undefined,
                                                        {websocket_info,[],
                                                         #{}},
                                                        undefined,undefined}},
                                                      {http2_state,<0.651.0>,
                                                       {sslsocket,
                                                        {gen_tcp,#Port<0.22>,
                                                         tls_connection,
                                                         undefined},
                                                        [<0.672.0>,<0.671.0>]},
                                                       gun_tls,
                                                       #{initial_connection_window_size =>
                                                          8000000,
                                                         initial_stream_window_size =>
                                                          8000000},
                                                       [gun_data_h],
                                                       <<>>,undefined,
                                                       undefined,connected,
                                                       {http2_machine,client,
                                                        #{initial_connection_window_size =>
                                                           8000000,
                                                          initial_stream_window_size =>
                                                           8000000,
                                                          message_tag =>
                                                           undefined},
                                                        normal,undefined,
                                                        undefined,
                                                        #{initial_window_size =>
                                                           8000000},
                                                        #{},
                                                        #{initial_window_size =>
                                                           65535},
                                                        65535,8000000,3,0,
                                                        2147483647,#{},[],
                                                        [1],
                                                        {state,0,4096,4096,[]},
                                                        {state,433,4096,4096,
                                                         [{173,
                                                           {<<"authorization">>,
                                                            <<236,89,159,101,
                                                              86,199,186,34,
                                                              229,35,53,199,
                                                              154,173,164,
                                                              103,198,212,
                                                              120,108,49,209,
                                                              211,114,140,
                                                              143,108,96,241,
                                                              6,105,29,166,
                                                              137,186,219,18,
                                                              227,156,64,70,
                                                              13,10,150,199,
                                                              179,118,105,
                                                              160,71,120,137,
                                                              177,178,25,149,
                                                              204,15,225,184,
                                                              152,190,90,156,
                                                              68,33,214,114,
                                                              115,101,36,55,
                                                              213,49,165,46,
                                                              206,216,82,138,
                                                              24,207,144,159,
                                                              66,221,191,27,
                                                              152,128,101,68,
                                                              136,132,60,58,
                                                              164,178,35,122,
                                                              192,211,242,
                                                              142,64,207,53,
                                                              246,71,176,195,
                                                              104,2,82,22,97,
                                                              136,27,103,157,
                                                              144,113,238,16,
                                                              205,232,75,61>>}},
                                                          {55,
                                                           {<<"sec-websocket-version">>,
                                                            <<"13">>}},
                                                          {50,
                                                           {<<":protocol">>,
                                                            <<"websocket">>}},
                                                          {109,
                                                           {<<":authority">>,
                                                            <<"admin.ccoud.net:4575">>}},
                                                          {46,
                                                           {<<":method">>,
                                                            <<"CONNECT">>}}]}},
                                                       #{},#{},0}} (Timestamp: {1704,
                                                                                896297,
                                                                                813241})
(<0.666.0>) returning to gun_http2:rst_stream_frame/5 (Timestamp: {1704,
                                                                   896297,
                                                                   813248})
(<0.666.0>) call gun_http2:stream_ref/2 (Timestamp: {1704,896297,813250})
(<0.666.0>) returned from gun_http2:stream_ref/2 -> #Ref<0.2683160591.2479882242.85291> (Timestamp: {1704,
                                                                                                     896297,
                                                                                                     813251})
(<0.666.0>) returning to gun_http2:rst_stream_frame/5 (Timestamp: {1704,
                                                                   896297,
                                                                   813252})
(<0.666.0>) <0.651.0> ! {gun_error,<0.666.0>,
                            #Ref<0.2683160591.2479882242.85291>,
                            {stream_error,protocol_error,
                                'Stream reset by server.'}} (Timestamp: {1704,
                                                                         896297,
                                                                         813254})
(<0.666.0>) call gun_http2:stream_ref/2 (Timestamp: {1704,896297,813256})
(<0.666.0>) returned from gun_http2:stream_ref/2 -> #Ref<0.2683160591.2479882242.85291> (Timestamp: {1704,
                                                                                                     896297,
                                                                                                     813257})
(<0.666.0>) returning to gun_http2:rst_stream_frame/5 (Timestamp: {1704,
                                                                   896297,
                                                                   813258})
(<0.666.0>) returned from gun_http2:rst_stream_frame/5 -> {{state,
                                                            {http2_state,
                                                             <0.651.0>,
                                                             {sslsocket,
                                                              {gen_tcp,
                                                               #Port<0.22>,
                                                               tls_connection,
                                                               undefined},
                                                              [<0.672.0>,
                                                               <0.671.0>]},
                                                             gun_tls,
                                                             #{initial_connection_window_size =>
                                                                8000000,
                                                               initial_stream_window_size =>
                                                                8000000},
                                                             [gun_data_h],
                                                             <<>>,undefined,
                                                             undefined,
                                                             connected,
                                                             {http2_machine,
                                                              client,
                                                              #{initial_connection_window_size =>
                                                                 8000000,
                                                                initial_stream_window_size =>
                                                                 8000000,
                                                                message_tag =>
                                                                 undefined},
                                                              normal,
                                                              undefined,
                                                              undefined,
                                                              #{initial_window_size =>
                                                                 8000000},
                                                              #{},
                                                              #{initial_window_size =>
                                                                 65535},
                                                              65535,8000000,3,
                                                              0,2147483647,
                                                              #{},[],
                                                              [1],
                                                              {state,0,4096,
                                                               4096,[]},
                                                              {state,433,
                                                               4096,4096,
                                                               [{173,
                                                                 {<<"authorization">>,
                                                                  <<236,89,
                                                                    159,101,
                                                                    86,199,
                                                                    186,34,
                                                                    229,35,
                                                                    53,199,
                                                                    154,173,
                                                                    164,103,
                                                                    198,212,
                                                                    120,108,
                                                                    49,209,
                                                                    211,114,
                                                                    140,143,
                                                                    108,96,
                                                                    241,6,
                                                                    105,29,
                                                                    166,137,
                                                                    186,219,
                                                                    18,227,
                                                                    156,64,
                                                                    70,13,10,
                                                                    150,199,
                                                                    179,118,
                                                                    105,160,
                                                                    71,120,
                                                                    137,177,
                                                                    178,25,
                                                                    149,204,
                                                                    15,225,
                                                                    184,152,
                                                                    190,90,
                                                                    156,68,
                                                                    33,214,
                                                                    114,115,
                                                                    101,36,
                                                                    55,213,
                                                                    49,165,
                                                                    46,206,
                                                                    216,82,
                                                                    138,24,
                                                                    207,144,
                                                                    159,66,
                                                                    221,191,
                                                                    27,152,
                                                                    128,101,
                                                                    68,136,
                                                                    132,60,
                                                                    58,164,
                                                                    178,35,
                                                                    122,192,
                                                                    211,242,
                                                                    142,64,
                                                                    207,53,
                                                                    246,71,
                                                                    176,195,
                                                                    104,2,82,
                                                                    22,97,
                                                                    136,27,
                                                                    103,157,
                                                                    144,113,
                                                                    238,16,
                                                                    205,232,
                                                                    75,61>>}},
                                                                {55,
                                                                 {<<"sec-websocket-version">>,
                                                                  <<"13">>}},
                                                                {50,
                                                                 {<<":protocol">>,
                                                                  <<"websocket">>}},
                                                                {109,
                                                                 {<<":authority">>,
                                                                  <<"admin.ccoud.net:4575">>}},
                                                                {46,
                                                                 {<<":method">>,
                                                                  <<"CONNECT">>}}]}},
                                                             #{},#{},0}},
                                                           undefined} (Timestamp: {1704,
                                                                                   896297,
                                                                                   813259})
(<0.666.0>) returning to gun_http2:frame/5 (Timestamp: {1704,896297,813261})
(<0.666.0>) returned from gun_http2:frame/5 -> {{state,
                                                 {http2_state,<0.651.0>,
                                                  {sslsocket,
                                                   {gen_tcp,#Port<0.22>,
                                                    tls_connection,undefined},
                                                   [<0.672.0>,<0.671.0>]},
                                                  gun_tls,
                                                  #{initial_connection_window_size =>
                                                     8000000,
                                                    initial_stream_window_size =>
                                                     8000000},
                                                  [gun_data_h],
                                                  <<>>,undefined,undefined,
                                                  connected,
                                                  {http2_machine,client,
                                                   #{initial_connection_window_size =>
                                                      8000000,
                                                     initial_stream_window_size =>
                                                      8000000,
                                                     message_tag => undefined},
                                                   normal,undefined,undefined,
                                                   #{initial_window_size =>
                                                      8000000},
                                                   #{},
                                                   #{initial_window_size =>
                                                      65535},
                                                   65535,8000000,3,0,
                                                   2147483647,#{},[],
                                                   [1],
                                                   {state,0,4096,4096,[]},
                                                   {state,433,4096,4096,
                                                    [{173,
                                                      {<<"authorization">>,
                                                       <<236,89,159,101,86,
                                                         199,186,34,229,35,
                                                         53,199,154,173,164,
                                                         103,198,212,120,108,
                                                         49,209,211,114,140,
                                                         143,108,96,241,6,
                                                         105,29,166,137,186,
                                                         219,18,227,156,64,
                                                         70,13,10,150,199,
                                                         179,118,105,160,71,
                                                         120,137,177,178,25,
                                                         149,204,15,225,184,
                                                         152,190,90,156,68,
                                                         33,214,114,115,101,
                                                         36,55,213,49,165,46,
                                                         206,216,82,138,24,
                                                         207,144,159,66,221,
                                                         191,27,152,128,101,
                                                         68,136,132,60,58,
                                                         164,178,35,122,192,
                                                         211,242,142,64,207,
                                                         53,246,71,176,195,
                                                         104,2,82,22,97,136,
                                                         27,103,157,144,113,
                                                         238,16,205,232,75,61>>}},
                                                     {55,
                                                      {<<"sec-websocket-version">>,
                                                       <<"13">>}},
                                                     {50,
                                                      {<<":protocol">>,
                                                       <<"websocket">>}},
                                                     {109,
                                                      {<<":authority">>,
                                                       <<"admin.ccoud.net:4575">>}},
                                                     {46,
                                                      {<<":method">>,
                                                       <<"CONNECT">>}}]}},
                                                  #{},#{},0}},
                                                undefined,undefined} (Timestamp: {1704,
                                                                                  896297,
                                                                                  813262})
(<0.666.0>) returning to gun_http2:parse/5 (Timestamp: {1704,896297,813264})
(<0.666.0>) call gun_http2:parse/5 (Timestamp: {1704,896297,813265})
(<0.666.0>) returned from gun_http2:parse/5 -> {{state,
                                                 {http2_state,<0.651.0>,
                                                  {sslsocket,
                                                   {gen_tcp,#Port<0.22>,
                                                    tls_connection,undefined},
                                                   [<0.672.0>,<0.671.0>]},
                                                  gun_tls,
                                                  #{initial_connection_window_size =>
                                                     8000000,
                                                    initial_stream_window_size =>
                                                     8000000},
                                                  [gun_data_h],
                                                  <<>>,undefined,undefined,
                                                  connected,
                                                  {http2_machine,client,
                                                   #{initial_connection_window_size =>
                                                      8000000,
                                                     initial_stream_window_size =>
                                                      8000000,
                                                     message_tag => undefined},
                                                   normal,undefined,undefined,
                                                   #{initial_window_size =>
                                                      8000000},
                                                   #{},
                                                   #{initial_window_size =>
                                                      65535},
                                                   65535,8000000,3,0,
                                                   2147483647,#{},[],
                                                   [1],
                                                   {state,0,4096,4096,[]},
                                                   {state,433,4096,4096,
                                                    [{173,
                                                      {<<"authorization">>,
                                                       <<236,89,159,101,86,
                                                         199,186,34,229,35,
                                                         53,199,154,173,164,
                                                         103,198,212,120,108,
                                                         49,209,211,114,140,
                                                         143,108,96,241,6,
                                                         105,29,166,137,186,
                                                         219,18,227,156,64,
                                                         70,13,10,150,199,
                                                         179,118,105,160,71,
                                                         120,137,177,178,25,
                                                         149,204,15,225,184,
                                                         152,190,90,156,68,
                                                         33,214,114,115,101,
                                                         36,55,213,49,165,46,
                                                         206,216,82,138,24,
                                                         207,144,159,66,221,
                                                         191,27,152,128,101,
                                                         68,136,132,60,58,
                                                         164,178,35,122,192,
                                                         211,242,142,64,207,
                                                         53,246,71,176,195,
                                                         104,2,82,22,97,136,
                                                         27,103,157,144,113,
                                                         238,16,205,232,75,61>>}},
                                                     {55,
                                                      {<<"sec-websocket-version">>,
                                                       <<"13">>}},
                                                     {50,
                                                      {<<":protocol">>,
                                                       <<"websocket">>}},
                                                     {109,
                                                      {<<":authority">>,
                                                       <<"admin.ccoud.net:4575">>}},
                                                     {46,
                                                      {<<":method">>,
                                                       <<"CONNECT">>}}]}},
                                                  #{},#{},0}},
                                                undefined,undefined} (Timestamp: {1704,
                                                                                  896297,
                                                                                  813266})
(<0.666.0>) returned from gun_http2:parse/5 -> {{state,
                                                 {http2_state,<0.651.0>,
                                                  {sslsocket,
                                                   {gen_tcp,#Port<0.22>,
                                                    tls_connection,undefined},
                                                   [<0.672.0>,<0.671.0>]},
                                                  gun_tls,
                                                  #{initial_connection_window_size =>
                                                     8000000,
                                                    initial_stream_window_size =>
                                                     8000000},
                                                  [gun_data_h],
                                                  <<>>,undefined,undefined,
                                                  connected,
                                                  {http2_machine,client,
                                                   #{initial_connection_window_size =>
                                                      8000000,
                                                     initial_stream_window_size =>
                                                      8000000,
                                                     message_tag => undefined},
                                                   normal,undefined,undefined,
                                                   #{initial_window_size =>
                                                      8000000},
                                                   #{},
                                                   #{initial_window_size =>
                                                      65535},
                                                   65535,8000000,3,0,
                                                   2147483647,#{},[],
                                                   [1],
                                                   {state,0,4096,4096,[]},
                                                   {state,433,4096,4096,
                                                    [{173,
                                                      {<<"authorization">>,
                                                       <<236,89,159,101,86,
                                                         199,186,34,229,35,
                                                         53,199,154,173,164,
                                                         103,198,212,120,108,
                                                         49,209,211,114,140,
                                                         143,108,96,241,6,
                                                         105,29,166,137,186,
                                                         219,18,227,156,64,
                                                         70,13,10,150,199,
                                                         179,118,105,160,71,
                                                         120,137,177,178,25,
                                                         149,204,15,225,184,
                                                         152,190,90,156,68,
                                                         33,214,114,115,101,
                                                         36,55,213,49,165,46,
                                                         206,216,82,138,24,
                                                         207,144,159,66,221,
                                                         191,27,152,128,101,
                                                         68,136,132,60,58,
                                                         164,178,35,122,192,
                                                         211,242,142,64,207,
                                                         53,246,71,176,195,
                                                         104,2,82,22,97,136,
                                                         27,103,157,144,113,
                                                         238,16,205,232,75,61>>}},
                                                     {55,
                                                      {<<"sec-websocket-version">>,
                                                       <<"13">>}},
                                                     {50,
                                                      {<<":protocol">>,
                                                       <<"websocket">>}},
                                                     {109,
                                                      {<<":authority">>,
                                                       <<"admin.ccoud.net:4575">>}},
                                                     {46,
                                                      {<<":method">>,
                                                       <<"CONNECT">>}}]}},
                                                  #{},#{},0}},
                                                undefined,undefined} (Timestamp: {1704,
                                                                                  896297,
                                                                                  813268})
(<0.666.0>) returned from gun_http2:handle/5 -> {{state,
                                                  {http2_state,<0.651.0>,
                                                   {sslsocket,
                                                    {gen_tcp,#Port<0.22>,
                                                     tls_connection,undefined},
                                                    [<0.672.0>,<0.671.0>]},
                                                   gun_tls,
                                                   #{initial_connection_window_size =>
                                                      8000000,
                                                     initial_stream_window_size =>
                                                      8000000},
                                                   [gun_data_h],
                                                   <<>>,undefined,undefined,
                                                   connected,
                                                   {http2_machine,client,
                                                    #{initial_connection_window_size =>
                                                       8000000,
                                                      initial_stream_window_size =>
                                                       8000000,
                                                      message_tag =>
                                                       undefined},
                                                    normal,undefined,
                                                    undefined,
                                                    #{initial_window_size =>
                                                       8000000},
                                                    #{},
                                                    #{initial_window_size =>
                                                       65535},
                                                    65535,8000000,3,0,
                                                    2147483647,#{},[],
                                                    [1],
                                                    {state,0,4096,4096,[]},
                                                    {state,433,4096,4096,
                                                     [{173,
                                                       {<<"authorization">>,
                                                        <<236,89,159,101,86,
                                                          199,186,34,229,35,
                                                          53,199,154,173,164,
                                                          103,198,212,120,
                                                          108,49,209,211,114,
                                                          140,143,108,96,241,
                                                          6,105,29,166,137,
                                                          186,219,18,227,156,
                                                          64,70,13,10,150,
                                                          199,179,118,105,
                                                          160,71,120,137,177,
                                                          178,25,149,204,15,
                                                          225,184,152,190,90,
                                                          156,68,33,214,114,
                                                          115,101,36,55,213,
                                                          49,165,46,206,216,
                                                          82,138,24,207,144,
                                                          159,66,221,191,27,
                                                          152,128,101,68,136,
                                                          132,60,58,164,178,
                                                          35,122,192,211,242,
                                                          142,64,207,53,246,
                                                          71,176,195,104,2,
                                                          82,22,97,136,27,
                                                          103,157,144,113,
                                                          238,16,205,232,75,
                                                          61>>}},
                                                      {55,
                                                       {<<"sec-websocket-version">>,
                                                        <<"13">>}},
                                                      {50,
                                                       {<<":protocol">>,
                                                        <<"websocket">>}},
                                                      {109,
                                                       {<<":authority">>,
                                                        <<"admin.ccoud.net:4575">>}},
                                                      {46,
                                                       {<<":method">>,
                                                        <<"CONNECT">>}}]}},
                                                   #{},#{},0}},
                                                 undefined,undefined} (Timestamp: {1704,
                                                                                   896297,
                                                                                   813270})
(<0.666.0>) returning to gun:handle_common_connected_no_input/4 (Timestamp: {1704,
                                                                             896297,
                                                                             813272})
(<0.666.0>) call gun:commands/2 (Timestamp: {1704,896297,813273})
(<0.666.0>) call gun:commands/2 (Timestamp: {1704,896297,813274})
(<0.666.0>) call gun:commands/2 (Timestamp: {1704,896297,813276})
(<0.666.0>) returned from gun:commands/2 -> {keep_state,
                                             {state,<0.651.0>,
                                              {up,
                                               #Ref<0.2683160591.2479882245.86377>},
                                              "admin.ccoud.net",
                                              4575,<<"https">>,
                                              "admin.ccoud.net",
                                              4575,[],
                                              #{trace => true,
                                                transport => tls,
                                                tls_opts =>
                                                 [{port,4576},
                                                  {verify,verify_peer},
                                                  {server_name_indication,
                                                   "admin.ccoud.net"},
                                                  {customize_hostname_check,
                                                   [{match_fun,
                                                     #Fun<public_key.6.117093159>}]},
                                                  {cacertfile,
                                                   <<"/app/priv/ssl/http/ca.crt">>}]},
                                              undefined,
                                              {sslsocket,
                                               {gen_tcp,#Port<0.22>,
                                                tls_connection,undefined},
                                               [<0.672.0>,<0.671.0>]},
                                              gun_tls,true,
                                              {ssl,ssl_closed,ssl_error},
                                              gun_http2,
                                              {http2_state,<0.651.0>,
                                               {sslsocket,
                                                {gen_tcp,#Port<0.22>,
                                                 tls_connection,undefined},
                                                [<0.672.0>,<0.671.0>]},
                                               gun_tls,
                                               #{initial_connection_window_size =>
                                                  8000000,
                                                 initial_stream_window_size =>
                                                  8000000},
                                               [gun_data_h],
                                               <<>>,undefined,undefined,
                                               connected,
                                               {http2_machine,client,
                                                #{initial_connection_window_size =>
                                                   8000000,
                                                  initial_stream_window_size =>
                                                   8000000,
                                                  message_tag => undefined},
                                                normal,undefined,undefined,
                                                #{initial_window_size =>
                                                   8000000},
                                                #{},
                                                #{initial_window_size =>
                                                   65535},
                                                65535,8000000,3,0,2147483647,
                                                #{},[],
                                                [1],
                                                {state,0,4096,4096,[]},
                                                {state,433,4096,4096,
                                                 [{173,
                                                   {<<"authorization">>,
                                                    <<236,89,159,101,86,199,
                                                      186,34,229,35,53,199,
                                                      154,173,164,103,198,
                                                      212,120,108,49,209,211,
                                                      114,140,143,108,96,241,
                                                      6,105,29,166,137,186,
                                                      219,18,227,156,64,70,
                                                      13,10,150,199,179,118,
                                                      105,160,71,120,137,177,
                                                      178,25,149,204,15,225,
                                                      184,152,190,90,156,68,
                                                      33,214,114,115,101,36,
                                                      55,213,49,165,46,206,
                                                      216,82,138,24,207,144,
                                                      159,66,221,191,27,152,
                                                      128,101,68,136,132,60,
                                                      58,164,178,35,122,192,
                                                      211,242,142,64,207,53,
                                                      246,71,176,195,104,2,
                                                      82,22,97,136,27,103,
                                                      157,144,113,238,16,205,
                                                      232,75,61>>}},
                                                  {55,
                                                   {<<"sec-websocket-version">>,
                                                    <<"13">>}},
                                                  {50,
                                                   {<<":protocol">>,
                                                    <<"websocket">>}},
                                                  {109,
                                                   {<<":authority">>,
                                                    <<"admin.ccoud.net:4575">>}},
                                                  {46,
                                                   {<<":method">>,
                                                    <<"CONNECT">>}}]}},
                                               #{},#{},0},
                                              undefined,gun_default_event_h,
                                              undefined}} (Timestamp: {1704,
                                                                       896297,
                                                                       813277})
(<0.666.0>) returned from gun:commands/2 -> {keep_state,
                                             {state,<0.651.0>,
                                              {up,
                                               #Ref<0.2683160591.2479882245.86377>},
                                              "admin.ccoud.net",
                                              4575,<<"https">>,
                                              "admin.ccoud.net",
                                              4575,[],
                                              #{trace => true,
                                                transport => tls,
                                                tls_opts =>
                                                 [{port,4576},
                                                  {verify,verify_peer},
                                                  {server_name_indication,
                                                   "admin.ccoud.net"},
                                                  {customize_hostname_check,
                                                   [{match_fun,
                                                     #Fun<public_key.6.117093159>}]},
                                                  {cacertfile,
                                                   <<"/app/priv/ssl/http/ca.crt">>}]},
                                              undefined,
                                              {sslsocket,
                                               {gen_tcp,#Port<0.22>,
                                                tls_connection,undefined},
                                               [<0.672.0>,<0.671.0>]},
                                              gun_tls,true,
                                              {ssl,ssl_closed,ssl_error},
                                              gun_http2,
                                              {http2_state,<0.651.0>,
                                               {sslsocket,
                                                {gen_tcp,#Port<0.22>,
                                                 tls_connection,undefined},
                                                [<0.672.0>,<0.671.0>]},
                                               gun_tls,
                                               #{initial_connection_window_size =>
                                                  8000000,
                                                 initial_stream_window_size =>
                                                  8000000},
                                               [gun_data_h],
                                               <<>>,undefined,undefined,
                                               connected,
                                               {http2_machine,client,
                                                #{initial_connection_window_size =>
                                                   8000000,
                                                  initial_stream_window_size =>
                                                   8000000,
                                                  message_tag => undefined},
                                                normal,undefined,undefined,
                                                #{initial_window_size =>
                                                   8000000},
                                                #{},
                                                #{initial_window_size =>
                                                   65535},
                                                65535,8000000,3,0,2147483647,
                                                #{},[],
                                                [1],
                                                {state,0,4096,4096,[]},
                                                {state,433,4096,4096,
                                                 [{173,
                                                   {<<"authorization">>,
                                                    <<236,89,159,101,86,199,
                                                      186,34,229,35,53,199,
                                                      154,173,164,103,198,
                                                      212,120,108,49,209,211,
                                                      114,140,143,108,96,241,
                                                      6,105,29,166,137,186,
                                                      219,18,227,156,64,70,
                                                      13,10,150,199,179,118,
                                                      105,160,71,120,137,177,
                                                      178,25,149,204,15,225,
                                                      184,152,190,90,156,68,
                                                      33,214,114,115,101,36,
                                                      55,213,49,165,46,206,
                                                      216,82,138,24,207,144,
                                                      159,66,221,191,27,152,
                                                      128,101,68,136,132,60,
                                                      58,164,178,35,122,192,
                                                      211,242,142,64,207,53,
                                                      246,71,176,195,104,2,
                                                      82,22,97,136,27,103,
                                                      157,144,113,238,16,205,
                                                      232,75,61>>}},
                                                  {55,
                                                   {<<"sec-websocket-version">>,
                                                    <<"13">>}},
                                                  {50,
                                                   {<<":protocol">>,
                                                    <<"websocket">>}},
                                                  {109,
                                                   {<<":authority">>,
                                                    <<"admin.ccoud.net:4575">>}},
                                                  {46,
                                                   {<<":method">>,
                                                    <<"CONNECT">>}}]}},
                                               #{},#{},0},
                                              undefined,gun_default_event_h,
                                              undefined}} (Timestamp: {1704,
                                                                       896297,
                                                                       813282})
(<0.666.0>) returned from gun:commands/2 -> {keep_state,
                                             {state,<0.651.0>,
                                              {up,
                                               #Ref<0.2683160591.2479882245.86377>},
                                              "admin.ccoud.net",
                                              4575,<<"https">>,
                                              "admin.ccoud.net",
                                              4575,[],
                                              #{trace => true,
                                                transport => tls,
                                                tls_opts =>
                                                 [{port,4576},
                                                  {verify,verify_peer},
                                                  {server_name_indication,
                                                   "admin.ccoud.net"},
                                                  {customize_hostname_check,
                                                   [{match_fun,
                                                     #Fun<public_key.6.117093159>}]},
                                                  {cacertfile,
                                                   <<"/app/priv/ssl/http/ca.crt">>}]},
                                              undefined,
                                              {sslsocket,
                                               {gen_tcp,#Port<0.22>,
                                                tls_connection,undefined},
                                               [<0.672.0>,<0.671.0>]},
                                              gun_tls,true,
                                              {ssl,ssl_closed,ssl_error},
                                              gun_http2,
                                              {http2_state,<0.651.0>,
                                               {sslsocket,
                                                {gen_tcp,#Port<0.22>,
                                                 tls_connection,undefined},
                                                [<0.672.0>,<0.671.0>]},
                                               gun_tls,
                                               #{initial_connection_window_size =>
                                                  8000000,
                                                 initial_stream_window_size =>
                                                  8000000},
                                               [gun_data_h],
                                               <<>>,undefined,undefined,
                                               connected,
                                               {http2_machine,client,
                                                #{initial_connection_window_size =>
                                                   8000000,
                                                  initial_stream_window_size =>
                                                   8000000,
                                                  message_tag => undefined},
                                                normal,undefined,undefined,
                                                #{initial_window_size =>
                                                   8000000},
                                                #{},
                                                #{initial_window_size =>
                                                   65535},
                                                65535,8000000,3,0,2147483647,
                                                #{},[],
                                                [1],
                                                {state,0,4096,4096,[]},
                                                {state,433,4096,4096,
                                                 [{173,
                                                   {<<"authorization">>,
                                                    <<236,89,159,101,86,199,
                                                      186,34,229,35,53,199,
                                                      154,173,164,103,198,
                                                      212,120,108,49,209,211,
                                                      114,140,143,108,96,241,
                                                      6,105,29,166,137,186,
                                                      219,18,227,156,64,70,
                                                      13,10,150,199,179,118,
                                                      105,160,71,120,137,177,
                                                      178,25,149,204,15,225,
                                                      184,152,190,90,156,68,
                                                      33,214,114,115,101,36,
                                                      55,213,49,165,46,206,
                                                      216,82,138,24,207,144,
                                                      159,66,221,191,27,152,
                                                      128,101,68,136,132,60,
                                                      58,164,178,35,122,192,
                                                      211,242,142,64,207,53,
                                                      246,71,176,195,104,2,
                                                      82,22,97,136,27,103,
                                                      157,144,113,238,16,205,
                                                      232,75,61>>}},
                                                  {55,
                                                   {<<"sec-websocket-version">>,
                                                    <<"13">>}},
                                                  {50,
                                                   {<<":protocol">>,
                                                    <<"websocket">>}},
                                                  {109,
                                                   {<<":authority">>,
                                                    <<"admin.ccoud.net:4575">>}},
                                                  {46,
                                                   {<<":method">>,
                                                    <<"CONNECT">>}}]}},
                                               #{},#{},0},
                                              undefined,gun_default_event_h,
                                              undefined}} (Timestamp: {1704,
                                                                       896297,
                                                                       813286})
(<0.666.0>) returning to gun:handle_common_connected_no_input/4 (Timestamp: {1704,
                                                                             896297,
                                                                             813290})
(<0.666.0>) call gun:maybe_active/1 (Timestamp: {1704,896297,813291})
(<0.666.0>) gc_minor_start [{wordsize,3},
 {old_heap_block_size,2586},
 {heap_block_size,2586},
 {mbuf_size,53},
 {recent_size,200},
 {stack_size,29},
 {old_heap_size,364},
 {heap_size,2552},
 {bin_vheap_size,115},
 {bin_vheap_block_size,46422},
 {bin_old_vheap_size,0},
 {bin_old_vheap_block_size,46422}] (Timestamp: {1704,896297,813296})
(<0.666.0>) gc_minor_end [{wordsize,2306},
 {old_heap_block_size,2586},
 {heap_block_size,987},
 {mbuf_size,0},
 {recent_size,277},
 {stack_size,29},
 {old_heap_size,386},
 {heap_size,277},
 {bin_vheap_size,8},
 {bin_vheap_block_size,46422},
 {bin_old_vheap_size,16},
 {bin_old_vheap_block_size,46422}] (Timestamp: {1704,896297,813311})
(<0.666.0>) call gun:active/1 (Timestamp: {1704,896297,813313})
(<0.666.0>) <0.672.0> ! {'$gen_call',{<0.666.0>,
                                      #Ref<0.2683160591.2479882245.86520>},
                                     {set_opts,[{active,once}]}} (Timestamp: {1704,
                                                                              896297,
                                                                              813319})
(<0.666.0>) out {gen,do_call,4} (Timestamp: {1704,896297,813322})
(<0.666.0>) in {gen,do_call,4} (Timestamp: {1704,896297,813337})
(<0.666.0>) << {#Ref<0.2683160591.2479882245.86520>,ok} (Timestamp: {1704,
                                                                     896297,
                                                                     813342})
(<0.666.0>) returned from gun:active/1 -> {ok,
                                           {state,<0.651.0>,
                                            {up,
                                             #Ref<0.2683160591.2479882245.86377>},
                                            "admin.ccoud.net",
                                            4575,<<"https">>,
                                            "admin.ccoud.net",
                                            4575,[],
                                            #{trace => true,transport => tls,
                                              tls_opts =>
                                               [{port,4576},
                                                {verify,verify_peer},
                                                {server_name_indication,
                                                 "admin.ccoud.net"},
                                                {customize_hostname_check,
                                                 [{match_fun,
                                                   #Fun<public_key.6.117093159>}]},
                                                {cacertfile,
                                                 <<"/app/priv/ssl/http/ca.crt">>}]},
                                            undefined,
                                            {sslsocket,
                                             {gen_tcp,#Port<0.22>,
                                              tls_connection,undefined},
                                             [<0.672.0>,<0.671.0>]},
                                            gun_tls,true,
                                            {ssl,ssl_closed,ssl_error},
                                            gun_http2,
                                            {http2_state,<0.651.0>,
                                             {sslsocket,
                                              {gen_tcp,#Port<0.22>,
                                               tls_connection,undefined},
                                              [<0.672.0>,<0.671.0>]},
                                             gun_tls,
                                             #{initial_connection_window_size =>
                                                8000000,
                                               initial_stream_window_size =>
                                                8000000},
                                             [gun_data_h],
                                             <<>>,undefined,undefined,
                                             connected,
                                             {http2_machine,client,
                                              #{initial_connection_window_size =>
                                                 8000000,
                                                initial_stream_window_size =>
                                                 8000000,
                                                message_tag => undefined},
                                              normal,undefined,undefined,
                                              #{initial_window_size =>
                                                 8000000},
                                              #{},
                                              #{initial_window_size => 65535},
                                              65535,8000000,3,0,2147483647,
                                              #{},[],
                                              [1],
                                              {state,0,4096,4096,[]},
                                              {state,433,4096,4096,
                                               [{173,
                                                 {<<"authorization">>,
                                                  <<236,89,159,101,86,199,
                                                    186,34,229,35,53,199,154,
                                                    173,164,103,198,212,120,
                                                    108,49,209,211,114,140,
                                                    143,108,96,241,6,105,29,
                                                    166,137,186,219,18,227,
                                                    156,64,70,13,10,150,199,
                                                    179,118,105,160,71,120,
                                                    137,177,178,25,149,204,
                                                    15,225,184,152,190,90,
                                                    156,68,33,214,114,115,
                                                    101,36,55,213,49,165,46,
                                                    206,216,82,138,24,207,
                                                    144,159,66,221,191,27,
                                                    152,128,101,68,136,132,
                                                    60,58,164,178,35,122,192,
                                                    211,242,142,64,207,53,
                                                    246,71,176,195,104,2,82,
                                                    22,97,136,27,103,157,144,
                                                    113,238,16,205,232,75,61>>}},
                                                {55,
                                                 {<<"sec-websocket-version">>,
                                                  <<"13">>}},
                                                {50,
                                                 {<<":protocol">>,
                                                  <<"websocket">>}},
                                                {109,
                                                 {<<":authority">>,
                                                  <<"admin.ccoud.net:4575">>}},
                                                {46,
                                                 {<<":method">>,
                                                  <<"CONNECT">>}}]}},
                                             #{},#{},0},
                                            undefined,gun_default_event_h,
                                            undefined}} (Timestamp: {1704,
                                                                     896297,
                                                                     813353})
(<0.666.0>) returning to gun:maybe_active/1 (Timestamp: {1704,896297,813361})
(<0.666.0>) returned from gun:maybe_active/1 -> {keep_state,
                                                 {state,<0.651.0>,
                                                  {up,
                                                   #Ref<0.2683160591.2479882245.86377>},
                                                  "admin.ccoud.net",
                                                  4575,<<"https">>,
                                                  "admin.ccoud.net",
                                                  4575,[],
                                                  #{trace => true,
                                                    transport => tls,
                                                    tls_opts =>
                                                     [{port,4576},
                                                      {verify,verify_peer},
                                                      {server_name_indication,
                                                       "admin.ccoud.net"},
                                                      {customize_hostname_check,
                                                       [{match_fun,
                                                         #Fun<public_key.6.117093159>}]},
                                                      {cacertfile,
                                                       <<"/app/priv/ssl/http/ca.crt">>}]},
                                                  undefined,
                                                  {sslsocket,
                                                   {gen_tcp,#Port<0.22>,
                                                    tls_connection,undefined},
                                                   [<0.672.0>,<0.671.0>]},
                                                  gun_tls,true,
                                                  {ssl,ssl_closed,ssl_error},
                                                  gun_http2,
                                                  {http2_state,<0.651.0>,
                                                   {sslsocket,
                                                    {gen_tcp,#Port<0.22>,
                                                     tls_connection,undefined},
                                                    [<0.672.0>,<0.671.0>]},
                                                   gun_tls,
                                                   #{initial_connection_window_size =>
                                                      8000000,
                                                     initial_stream_window_size =>
                                                      8000000},
                                                   [gun_data_h],
                                                   <<>>,undefined,undefined,
                                                   connected,
                                                   {http2_machine,client,
                                                    #{initial_connection_window_size =>
                                                       8000000,
                                                      initial_stream_window_size =>
                                                       8000000,
                                                      message_tag =>
                                                       undefined},
                                                    normal,undefined,
                                                    undefined,
                                                    #{initial_window_size =>
                                                       8000000},
                                                    #{},
                                                    #{initial_window_size =>
                                                       65535},
                                                    65535,8000000,3,0,
                                                    2147483647,#{},[],
                                                    [1],
                                                    {state,0,4096,4096,[]},
                                                    {state,433,4096,4096,
                                                     [{173,
                                                       {<<"authorization">>,
                                                        <<236,89,159,101,86,
                                                          199,186,34,229,35,
                                                          53,199,154,173,164,
                                                          103,198,212,120,
                                                          108,49,209,211,114,
                                                          140,143,108,96,241,
                                                          6,105,29,166,137,
                                                          186,219,18,227,156,
                                                          64,70,13,10,150,
                                                          199,179,118,105,
                                                          160,71,120,137,177,
                                                          178,25,149,204,15,
                                                          225,184,152,190,90,
                                                          156,68,33,214,114,
                                                          115,101,36,55,213,
                                                          49,165,46,206,216,
                                                          82,138,24,207,144,
                                                          159,66,221,191,27,
                                                          152,128,101,68,136,
                                                          132,60,58,164,178,
                                                          35,122,192,211,242,
                                                          142,64,207,53,246,
                                                          71,176,195,104,2,
                                                          82,22,97,136,27,
                                                          103,157,144,113,
                                                          238,16,205,232,75,
                                                          61>>}},
                                                      {55,
                                                       {<<"sec-websocket-version">>,
                                                        <<"13">>}},
                                                      {50,
                                                       {<<":protocol">>,
                                                        <<"websocket">>}},
                                                      {109,
                                                       {<<":authority">>,
                                                        <<"admin.ccoud.net:4575">>}},
                                                      {46,
                                                       {<<":method">>,
                                                        <<"CONNECT">>}}]}},
                                                   #{},#{},0},
                                                  undefined,
                                                  gun_default_event_h,
                                                  undefined}} (Timestamp: {1704,
                                                                           896297,
                                                                           813362})
(<0.666.0>) returned from gun:handle_common_connected_no_input/4 -> {keep_state,
                                                                     {state,
                                                                      <0.651.0>,
                                                                      {up,
                                                                       #Ref<0.2683160591.2479882245.86377>},
                                                                      "admin.ccoud.net",
                                                                      4575,
                                                                      <<"https">>,
                                                                      "admin.ccoud.net",
                                                                      4575,[],
                                                                      #{trace =>
                                                                         true,
                                                                        transport =>
                                                                         tls,
                                                                        tls_opts =>
                                                                         [{port,
                                                                           4576},
                                                                          {verify,
                                                                           verify_peer},
                                                                          {server_name_indication,
                                                                           "admin.ccoud.net"},
                                                                          {customize_hostname_check,
                                                                           [{match_fun,
                                                                             #Fun<public_key.6.117093159>}]},
                                                                          {cacertfile,
                                                                           <<"/app/priv/ssl/http/ca.crt">>}]},
                                                                      undefined,
                                                                      {sslsocket,
                                                                       {gen_tcp,
                                                                        #Port<0.22>,
                                                                        tls_connection,
                                                                        undefined},
                                                                       [<0.672.0>,
                                                                        <0.671.0>]},
                                                                      gun_tls,
                                                                      true,
                                                                      {ssl,
                                                                       ssl_closed,
                                                                       ssl_error},
                                                                      gun_http2,
                                                                      {http2_state,
                                                                       <0.651.0>,
                                                                       {sslsocket,
                                                                        {gen_tcp,
                                                                         #Port<0.22>,
                                                                         tls_connection,
                                                                         undefined},
                                                                        [<0.672.0>,
                                                                         <0.671.0>]},
                                                                       gun_tls,
                                                                       #{initial_connection_window_size =>
                                                                          8000000,
                                                                         initial_stream_window_size =>
                                                                          8000000},
                                                                       [gun_data_h],
                                                                       <<>>,
                                                                       undefined,
                                                                       undefined,
                                                                       connected,
                                                                       {http2_machine,
                                                                        client,
                                                                        #{initial_connection_window_size =>
                                                                           8000000,
                                                                          initial_stream_window_size =>
                                                                           8000000,
                                                                          message_tag =>
                                                                           undefined},
                                                                        normal,
                                                                        undefined,
                                                                        undefined,
                                                                        #{initial_window_size =>
                                                                           8000000},
                                                                        #{},
                                                                        #{initial_window_size =>
                                                                           65535},
                                                                        65535,
                                                                        8000000,
                                                                        3,0,
                                                                        2147483647,
                                                                        #{},
                                                                        [],
                                                                        [1],
                                                                        {state,
                                                                         0,
                                                                         4096,
                                                                         4096,
                                                                         []},
                                                                        {state,
                                                                         433,
                                                                         4096,
                                                                         4096,
                                                                         [{173,
                                                                           {<<"authorization">>,
                                                                            <<236,89,
                                                                              159,101,
                                                                              86,199,
                                                                              186,34,
                                                                              229,35,
                                                                              53,199,
                                                                              154,173,
                                                                              164,103,
                                                                              198,212,
                                                                              120,108,
                                                                              49,209,
                                                                              211,114,
                                                                              140,143,
                                                                              108,96,
                                                                              241,6,
                                                                              105,29,
                                                                              166,137,
                                                                              186,219,
                                                                              18,227,
                                                                              156,64,
                                                                              70,13,
                                                                              10,150,
                                                                              199,179,
                                                                              118,105,
                                                                              160,71,
                                                                              120,137,
                                                                              177,178,
                                                                              25,149,
                                                                              204,15,
                                                                              225,184,
                                                                              152,190,
                                                                              90,156,
                                                                              68,33,
                                                                              214,114,
                                                                              115,101,
                                                                              36,55,
                                                                              213,49,
                                                                              165,46,
                                                                              206,216,
                                                                              82,138,
                                                                              24,207,
                                                                              144,159,
                                                                              66,221,
                                                                              191,27,
                                                                              152,128,
                                                                              101,68,
                                                                              136,132,
                                                                              60,58,
                                                                              164,178,
                                                                              35,122,
                                                                              192,211,
                                                                              242,142,
                                                                              64,207,
                                                                              53,246,
                                                                              71,176,
                                                                              195,104,
                                                                              2,82,22,
                                                                              97,136,
                                                                              27,103,
                                                                              157,144,
                                                                              113,238,
                                                                              16,205,
                                                                              232,75,
                                                                              61>>}},
                                                                          {55,
                                                                           {<<"sec-websocket-version">>,
                                                                            <<"13">>}},
                                                                          {50,
                                                                           {<<":protocol">>,
                                                                            <<"websocket">>}},
                                                                          {109,
                                                                           {<<":authority">>,
                                                                            <<"admin.ccoud.net:4575">>}},
                                                                          {46,
                                                                           {<<":method">>,
                                                                            <<"CONNECT">>}}]}},
                                                                       #{},
                                                                       #{},0},
                                                                      undefined,
                                                                      gun_default_event_h,
                                                                      undefined}} (Timestamp: {1704,
                                                                                               896297,
                                                                                               813368})
(<0.666.0>) returned from gun:handle_common_connected/4 -> {keep_state,
                                                            {state,<0.651.0>,
                                                             {up,
                                                              #Ref<0.2683160591.2479882245.86377>},
                                                             "admin.ccoud.net",
                                                             4575,<<"https">>,
                                                             "admin.ccoud.net",
                                                             4575,[],
                                                             #{trace => true,
                                                               transport =>
                                                                tls,
                                                               tls_opts =>
                                                                [{port,4576},
                                                                 {verify,
                                                                  verify_peer},
                                                                 {server_name_indication,
                                                                  "admin.ccoud.net"},
                                                                 {customize_hostname_check,
                                                                  [{match_fun,
                                                                    #Fun<public_key.6.117093159>}]},
                                                                 {cacertfile,
                                                                  <<"/app/priv/ssl/http/ca.crt">>}]},
                                                             undefined,
                                                             {sslsocket,
                                                              {gen_tcp,
                                                               #Port<0.22>,
                                                               tls_connection,
                                                               undefined},
                                                              [<0.672.0>,
                                                               <0.671.0>]},
                                                             gun_tls,true,
                                                             {ssl,ssl_closed,
                                                              ssl_error},
                                                             gun_http2,
                                                             {http2_state,
                                                              <0.651.0>,
                                                              {sslsocket,
                                                               {gen_tcp,
                                                                #Port<0.22>,
                                                                tls_connection,
                                                                undefined},
                                                               [<0.672.0>,
                                                                <0.671.0>]},
                                                              gun_tls,
                                                              #{initial_connection_window_size =>
                                                                 8000000,
                                                                initial_stream_window_size =>
                                                                 8000000},
                                                              [gun_data_h],
                                                              <<>>,undefined,
                                                              undefined,
                                                              connected,
                                                              {http2_machine,
                                                               client,
                                                               #{initial_connection_window_size =>
                                                                  8000000,
                                                                 initial_stream_window_size =>
                                                                  8000000,
                                                                 message_tag =>
                                                                  undefined},
                                                               normal,
                                                               undefined,
                                                               undefined,
                                                               #{initial_window_size =>
                                                                  8000000},
                                                               #{},
                                                               #{initial_window_size =>
                                                                  65535},
                                                               65535,8000000,
                                                               3,0,2147483647,
                                                               #{},[],
                                                               [1],
                                                               {state,0,4096,
                                                                4096,[]},
                                                               {state,433,
                                                                4096,4096,
                                                                [{173,
                                                                  {<<"authorization">>,
                                                                   <<236,89,
                                                                     159,101,
                                                                     86,199,
                                                                     186,34,
                                                                     229,35,
                                                                     53,199,
                                                                     154,173,
                                                                     164,103,
                                                                     198,212,
                                                                     120,108,
                                                                     49,209,
                                                                     211,114,
                                                                     140,143,
                                                                     108,96,
                                                                     241,6,
                                                                     105,29,
                                                                     166,137,
                                                                     186,219,
                                                                     18,227,
                                                                     156,64,
                                                                     70,13,
                                                                     10,150,
                                                                     199,179,
                                                                     118,105,
                                                                     160,71,
                                                                     120,137,
                                                                     177,178,
                                                                     25,149,
                                                                     204,15,
                                                                     225,184,
                                                                     152,190,
                                                                     90,156,
                                                                     68,33,
                                                                     214,114,
                                                                     115,101,
                                                                     36,55,
                                                                     213,49,
                                                                     165,46,
                                                                     206,216,
                                                                     82,138,
                                                                     24,207,
                                                                     144,159,
                                                                     66,221,
                                                                     191,27,
                                                                     152,128,
                                                                     101,68,
                                                                     136,132,
                                                                     60,58,
                                                                     164,178,
                                                                     35,122,
                                                                     192,211,
                                                                     242,142,
                                                                     64,207,
                                                                     53,246,
                                                                     71,176,
                                                                     195,104,
                                                                     2,82,22,
                                                                     97,136,
                                                                     27,103,
                                                                     157,144,
                                                                     113,238,
                                                                     16,205,
                                                                     232,75,
                                                                     61>>}},
                                                                 {55,
                                                                  {<<"sec-websocket-version">>,
                                                                   <<"13">>}},
                                                                 {50,
                                                                  {<<":protocol">>,
                                                                   <<"websocket">>}},
                                                                 {109,
                                                                  {<<":authority">>,
                                                                   <<"admin.ccoud.net:4575">>}},
                                                                 {46,
                                                                  {<<":method">>,
                                                                   <<"CONNECT">>}}]}},
                                                              #{},#{},0},
                                                             undefined,
                                                             gun_default_event_h,
                                                             undefined}} (Timestamp: {1704,
                                                                                      896297,
                                                                                      813372})
(<0.666.0>) returned from gun:connected/3 -> {keep_state,
                                              {state,<0.651.0>,
                                               {up,
                                                #Ref<0.2683160591.2479882245.86377>},
                                               "admin.ccoud.net",
                                               4575,<<"https">>,
                                               "admin.ccoud.net",
                                               4575,[],
                                               #{trace => true,
                                                 transport => tls,
                                                 tls_opts =>
                                                  [{port,4576},
                                                   {verify,verify_peer},
                                                   {server_name_indication,
                                                    "admin.ccoud.net"},
                                                   {customize_hostname_check,
                                                    [{match_fun,
                                                      #Fun<public_key.6.117093159>}]},
                                                   {cacertfile,
                                                    <<"/app/priv/ssl/http/ca.crt">>}]},
                                               undefined,
                                               {sslsocket,
                                                {gen_tcp,#Port<0.22>,
                                                 tls_connection,undefined},
                                                [<0.672.0>,<0.671.0>]},
                                               gun_tls,true,
                                               {ssl,ssl_closed,ssl_error},
                                               gun_http2,
                                               {http2_state,<0.651.0>,
                                                {sslsocket,
                                                 {gen_tcp,#Port<0.22>,
                                                  tls_connection,undefined},
                                                 [<0.672.0>,<0.671.0>]},
                                                gun_tls,
                                                #{initial_connection_window_size =>
                                                   8000000,
                                                  initial_stream_window_size =>
                                                   8000000},
                                                [gun_data_h],
                                                <<>>,undefined,undefined,
                                                connected,
                                                {http2_machine,client,
                                                 #{initial_connection_window_size =>
                                                    8000000,
                                                   initial_stream_window_size =>
                                                    8000000,
                                                   message_tag => undefined},
                                                 normal,undefined,undefined,
                                                 #{initial_window_size =>
                                                    8000000},
                                                 #{},
                                                 #{initial_window_size =>
                                                    65535},
                                                 65535,8000000,3,0,2147483647,
                                                 #{},[],
                                                 [1],
                                                 {state,0,4096,4096,[]},
                                                 {state,433,4096,4096,
                                                  [{173,
                                                    {<<"authorization">>,
                                                     <<236,89,159,101,86,199,
                                                       186,34,229,35,53,199,
                                                       154,173,164,103,198,
                                                       212,120,108,49,209,
                                                       211,114,140,143,108,
                                                       96,241,6,105,29,166,
                                                       137,186,219,18,227,
                                                       156,64,70,13,10,150,
                                                       199,179,118,105,160,
                                                       71,120,137,177,178,25,
                                                       149,204,15,225,184,
                                                       152,190,90,156,68,33,
                                                       214,114,115,101,36,55,
                                                       213,49,165,46,206,216,
                                                       82,138,24,207,144,159,
                                                       66,221,191,27,152,128,
                                                       101,68,136,132,60,58,
                                                       164,178,35,122,192,
                                                       211,242,142,64,207,53,
                                                       246,71,176,195,104,2,
                                                       82,22,97,136,27,103,
                                                       157,144,113,238,16,
                                                       205,232,75,61>>}},
                                                   {55,
                                                    {<<"sec-websocket-version">>,
                                                     <<"13">>}},
                                                   {50,
                                                    {<<":protocol">>,
                                                     <<"websocket">>}},
                                                   {109,
                                                    {<<":authority">>,
                                                     <<"admin.ccoud.net:4575">>}},
                                                   {46,
                                                    {<<":method">>,
                                                     <<"CONNECT">>}}]}},
                                                #{},#{},0},
                                               undefined,gun_default_event_h,
                                               undefined}} (Timestamp: {1704,
                                                                        896297,
                                                                        813377})
(<0.666.0>) returning to gen_statem:loop_state_callback/11 (Timestamp: {1704,
                                                                        896297,
                                                                        813382})
(<0.666.0>) out {gen_statem,loop_receive,3} (Timestamp: {1704,896297,813384})

@ns-blee
Copy link
Author

ns-blee commented Jan 10, 2024

@essen added. Thank you. Look forward to hearing back!

EDIT: reformatted

@ns-blee
Copy link
Author

ns-blee commented Jan 11, 2024

@essen

I though :cowboy was being made available through cowboy_plug when its not... the issue remains the same with some caveats

:application.get_key(:cowboy, :vsn) |> IO.inspect() == {:ok, ~c"2.10.0"}

I can replicate the issue in my local env using self signed certs. Same error message anyway, tracing looks the same.

Various combinations of tls_ops render the same :gun error

@essen
Copy link
Member

essen commented Jan 11, 2024

Oh that's Websocket? For Websocket over HTTP/2 you need to enable the CONNECT protocol in Cowboy, see: https://github.com/ninenines/gun/blob/master/test/ws_SUITE.erl#L47

You cannot use Websocket until the setting is set (see the test suite for how to wait for the right moment).

Alternatively you can disable HTTP/2 in Gun if you don't need it.

The problem occurs with TLS but not TCP because TLS uses ALPN to select the protocol and that defaults to HTTP/2.

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

2 participants