-
Notifications
You must be signed in to change notification settings - Fork 57
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:
plug_cowboy/lib/plug/cowboy.ex
Lines 293 to 294 in 553b43e
| |> 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
]
]
]