diff --git a/examples/https-client/https-client.go b/examples/https-client/https-client.go deleted file mode 100644 index 23fa060..0000000 --- a/examples/https-client/https-client.go +++ /dev/null @@ -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)) -} diff --git a/examples/https-servers/.gitignore b/examples/https-servers/.gitignore deleted file mode 100644 index 4917c09..0000000 --- a/examples/https-servers/.gitignore +++ /dev/null @@ -1 +0,0 @@ -server.* diff --git a/examples/https-servers/https-servers.go b/examples/https-servers/https-servers.go deleted file mode 100644 index 2820ae4..0000000 --- a/examples/https-servers/https-servers.go +++ /dev/null @@ -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) - } -} diff --git a/examples/https-servers/https-servers.sh b/examples/https-servers/https-servers.sh deleted file mode 100644 index 5019a74..0000000 --- a/examples/https-servers/https-servers.sh +++ /dev/null @@ -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/