Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[warning] Transport option {:next_protocols_advertised, ["h2", "http/1.1"]} unknown or invalid.

Closed
#111 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
elixir
Domain
networking

Research direction

Start at lib/plug_cowboy.ex lines 293-294 and compare the configured option with Erlang SSL's server options. Investigate the backwards-compatibility concern raised in the issue before deciding whether the deprecated setting can be removed. Done means the startup warning is resolved without breaking HTTPS transport configuration.

Written by the indexing model from the issue text.

Description

When running a Phoenix project using plug_cowboy 2.7.5 I get the following warning on startup:

[warning] Transport option {:next_protocols_advertised, ["h2", "http/1.1"]} unknown or invalid.

I believe this is happening because of the code here: https://github.com/elixir-plug/plug_cowboy/blob/553b43e40e35ba5d92ed8f99bffaf181e6aba18b/lib/plug/cowboy.ex#L293-L294

From what I gather :next_protocols_advertised has been deprecated (https://www.erlang.org/doc/apps/ssl/ssl.html#t:server_option_legacy/0) in favor of :alpn_preferred_protocols.

Maybe there are some backwards compatibility issues that are problematic, but otherwise I think it'd be great to simply remove the setting of :next_protocols_advertised. If that's not possible maybe we could create a way to explicitly unset :next_protocols_advertised, similar to the code below?

config :app, AppWeb.Endpoint,
    ...
    https: [
        ...
        transport_options: [
            socket_opts: [
                next_protocols_advertised: nil
            ]
        ]
    ]    
Dominant language
Elixir
Stars
264
Forks
59
Avg merge
6h
Merged PRs (30d)
1

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from elixir-plug/plug_cowboy

All issues in elixir-plug/plug_cowboy

Similar issues

More Elixir issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.