title: net/http GET request error tls oversized record received with length 20527
body: <p>I'm stucking  to perform a get request using Golang and I also have tried three distinct implementations without success. For all them I'm receiving this error message:</p>
  
  <p><strong>Get <a href="https://11.11.11.1:0000/httpgw.conf?Type=SMS&amp;Address=12345678&amp;MsgID=12" rel="nofollow noreferrer">https://11.11.11.1:0000/httpgw.conf?Type=SMS&amp;Address=12345678&amp;MsgID=12</a>
  3&amp;Notify=N&amp;Validity=24:00&amp;OAdC=15555&amp;Message=HelloBrother: tls: oversized recor
  d received with length 20527</strong></p>
  
  <p>Bellow is the entire source code that I'm working on:</p>
  
  <pre><code>    package main
  
  import (
      "crypto/tls"
      "fmt"
      "io/ioutil"
      "net/http"
      "os"
  )
  
  func main() {
  
      cmdSecSMS := "https://11.11.11.1:0000/httpgw.conf?Type=SMS&amp;Address=12345678&amp;MsgID=123&amp;Notify=N&amp;Validity=24:00&amp;OAdC=15555&amp;Message="
      msg := "HelloBrother"
      cmdSecUrlSMS := cmdSecSMS + msg
  
      doClientTrans(cmdSecUrlSMS)
  
      doGetClient(cmdSecUrlSMS)
  
      doGet(cmdSecUrlSMS)
  }
  
  func doClientTrans(address string) {
      tr := &amp;http.Transport{
          TLSClientConfig: &amp;tls.Config{InsecureSkipVerify: true},
      }
  
      client := &amp;http.Client{Transport: tr}
  
      response, err := client.Get(address)
      if err != nil {
          fmt.Printf("%s", err)
          os.Exit(1)
      } else {
          defer response.Body.Close()
          contents, err := ioutil.ReadAll(response.Body)
          if err != nil {
              fmt.Printf("%s", err)
              os.Exit(1)
          }
          fmt.Printf("%s\n", string(contents))
          fmt.Println(" Size: ", len(string(contents)), " url: ", address)
          fmt.Println(" Status Code:  ", response.StatusCode)
          hdr := response.Header
          for key, value := range hdr {
              fmt.Println(" ", key, ":", value)
          }
      }
  }
  
  func doGet(url string) {
      response, err := http.Get(url)
      if err != nil {
          fmt.Printf("%s", err)
          os.Exit(1)
      } else {
          defer response.Body.Close()
          contents, err := ioutil.ReadAll(response.Body)
          if err != nil {
              fmt.Printf("%s", err)
              os.Exit(1)
          }
          fmt.Println(" Size: ", len(string(contents)), " url: ", url)
          fmt.Println(" Status Code:  ", response.StatusCode)
          hdr := response.Header
          for key, value := range hdr {
              fmt.Println(" ", key, ":", value)
          }
      }
  }
  
  func doGetClient(url string) {
      client := &amp;http.Client{}
  
      response, err := client.Get(url)
      if err != nil {
          fmt.Printf("%s", err)
          os.Exit(1)
      } else {
          defer response.Body.Close()
          contents, err := ioutil.ReadAll(response.Body)
          if err != nil {
              fmt.Printf("%s", err)
              os.Exit(1)
          }
          fmt.Println(" Size: ", len(string(contents)), " url: ", url)
          fmt.Println(" Status Code: ", response.StatusCode)
          hdr := response.Header
          for key, value := range hdr {
              fmt.Println(" ", key, ":", value)
          }
      }
  }
  </code></pre>
  
  <p>When using telnet, this GET request works normally:</p>
  
  <p>telnet 11.11.11.1 0000</p>
  
  <p>Get <a href="https://11.11.11.1:0000/httpgw.conf?Type=SMS&amp;Address=12345678&amp;MsgID=12" rel="nofollow noreferrer">https://11.11.11.1:0000/httpgw.conf?Type=SMS&amp;Address=12345678&amp;MsgID=12</a>
  3&amp;Notify=N&amp;Validity=24:00&amp;OAdC=15555&amp;Message=HelloBrother HTTP/1.1</p>
  
  <p>^:
  exit </p>
  
  <p><a href="https://i.stack.imgur.com/IghmM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IghmM.png" alt="enter image description here"></a></p>
  
  <p>I'm running the golang app in the windows server 2012 and I don't know nothing about the server tech stack.</p>
  
  <p>It's possible to fix this issue? There is a configuration workaround or something else that I can try?</p>
  
  <p>thanks for your help</p>