Skip to content

http.Server always responses with http/1.1! #18462

@mziraki

Description

@mziraki

What version of Go are you using (go version)?

1.7.4

What operating system and processor architecture are you using (go env)?

os: windows
arch: amd64

What did you do?

package main

import (
	"log"
	"net/http"
)

func main() {
	http.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) {
		w.Write([]byte("This is an example server.\n"))
	})
	log.Fatalln(http.ListenAndServeTLS(":443", "certificate.crt", "private.key", nil))
}

What did you expect to see?

http/2 response

What did you see instead?

http/1.1 response, what did I do wrong in sample code above?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions