One serious potential issue is that the URL scheme is still "http" (or
"https") for both. With TLS, the client and server can negotiate an
on-the-wire protocol using ALPN. This allows client and server to decide on
HTTP 1.1 or http/2 based on what they support.

But over plain-text, there is no such protocol negotiation phase. So the
client must assume HTTP 1.1 (because not all servers yet support HTTP/2).
There is an upgrade mechanism, whereby a client can start an HTTP 1.1
request and include special headers to request upgrading to HTTP/2 on the
same connection (see the spec
<https://http2.github.io/http2-spec/#discover-http> for more details). (I
am not sure if Go HTTP servers actually support this update mechanism,
though.)

But without a protocol negotiation step or upgrade request, it is unsafe
for a client to assume HTTP/2. You have to know what you are doing, and
thus it requires you to be more explicit in both client and server code to
make it work.


----
*Josh Humphries*
jh...@bluegosling.com

On Wed, Nov 15, 2017 at 3:43 PM, Albert Tedja <nicho.te...@gmail.com> wrote:

> Thank you for the links.
>
> I am still somewhat disappointed that the http/2 protocol would enforce a
> certain configuration. I understand the necessity of secure connections,
> but that's should be left as an option to the developers.
>
> If browsers want to strictly use TLS, that's fine because it's consumer
> facing, but at least Go should enable http/2 over non-TLS. We are engineers
> here, we should know the difference.
>
>
>
> On Wednesday, November 15, 2017 at 12:05:41 PM UTC-8, Howard C. Shaw III
> wrote:
>>
>> See
>> https://github.com/golang/go/issues/14141 - for discussion of the issue;
>> and
>> https://github.com/hkwi/h2c for a way to use the in
>> stdlib-but-not-linked-together support for h2c (http/2 over non-TLS).
>>
>> Howard
>>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to