From 872b1db63a75f95ce180abb5a2b1def7fe395a7a Mon Sep 17 00:00:00 2001 From: Roland Kammerer Date: Thu, 6 Jul 2017 18:48:04 +0200 Subject: [PATCH] disable http/2 Looks like the simplepush.io server does not speak http/2 (which is the default in more "recent" golang versions). --- simplepush.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/simplepush.go b/simplepush.go index 10c9150..d51bf00 100644 --- a/simplepush.go +++ b/simplepush.go @@ -7,6 +7,7 @@ import ( "crypto/cipher" "crypto/rand" "crypto/sha1" + "crypto/tls" "encoding/base64" "encoding/hex" "errors" @@ -112,7 +113,10 @@ func Send(m Message) error { u.Path = resource urlStr := fmt.Sprintf("%v", u) - client := &http.Client{} + tr := &http.Transport{ + TLSNextProto: make(map[string]func(string, *tls.Conn) http.RoundTripper), + } + client := &http.Client{Transport: tr} resp, err := client.PostForm(urlStr, data) if err != nil {