Skip to content

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

@eriknaslund

Description

@eriknaslund

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:

|> Keyword.put_new(:next_protocols_advertised, ["h2", "http/1.1"])
|> Keyword.put_new(:alpn_preferred_protocols, ["h2", "http/1.1"])

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
            ]
        ]
    ]    

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions