Remove unused HTTPS example code

A bad example with verify none.
This commit is contained in:
Mark McGranaghan 2014-02-10 01:28:16 -08:00
parent 4f4b2169a3
commit e6523e8703
4 changed files with 0 additions and 49 deletions

@ -1,19 +0,0 @@
package main
import "net/http"
import "crypto/tls"
import "io/ioutil"
import "fmt"
func main() {
conf := &tls.Config{InsecureSkipVerify: true}
trans := &http.Transport{TLSClientConfig: conf}
client := &http.Client{Transport: trans}
resp, err := client.Get("https://127.0.0.1:5000/")
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
fmt.Print(string(body))
}

@ -1 +0,0 @@
server.*

@ -1,17 +0,0 @@
package main
import "net/http"
func handler(res http.ResponseWriter, req *http.Request) {
res.Header().Set("Content-Type", "text/plain")
res.Write([]byte("Hello from HTTPS\n"))
}
func main() {
http.HandleFunc("/", handler)
err := http.ListenAndServeTLS(":5000",
"/tmp/server.crt", "/tmp/server.key", nil)
if err != nil {
panic(err)
}
}

@ -1,12 +0,0 @@
$ cd /tmp
$ rm -f server.*
$ openssl genrsa -des3 -out server.orig.key 2048
$ openssl rsa -in server.orig.key -out server.key
$ openssl req -new -key server.key -out server.csr
$ openssl x509 -req -days 365 -in server.csr \
-signkey server.key -out server.crt
$ go run https-servers.go
$ curl https://127.0.0.1:5000/
$ curl --insecure https://127.0.0.1:5000/