|
|
@ -10,7 +10,9 @@ import (
|
|
|
|
"net"
|
|
|
|
"net"
|
|
|
|
"net/http"
|
|
|
|
"net/http"
|
|
|
|
"os"
|
|
|
|
"os"
|
|
|
|
|
|
|
|
"runtime"
|
|
|
|
"testing"
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
func TestTLSClient(t *testing.T) {
|
|
|
|
func TestTLSClient(t *testing.T) {
|
|
|
@ -134,6 +136,8 @@ func TestTLSServer(t *testing.T) {
|
|
|
|
if string(buf[:n]) != data {
|
|
|
|
if string(buf[:n]) != data {
|
|
|
|
t.Errorf("need: %s, got: %s", data, string(buf[:n]))
|
|
|
|
t.Errorf("need: %s, got: %s", data, string(buf[:n]))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
runtime.GC()
|
|
|
|
|
|
|
|
time.Sleep(1 * time.Second)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func TestTLSALPNServer(t *testing.T) {
|
|
|
|
func TestTLSALPNServer(t *testing.T) {
|
|
|
@ -220,6 +224,8 @@ func TestTLSALPNServer(t *testing.T) {
|
|
|
|
if string(buf[:n]) != data {
|
|
|
|
if string(buf[:n]) != data {
|
|
|
|
t.Errorf("need: %s, got: %s", data, string(buf[:n]))
|
|
|
|
t.Errorf("need: %s, got: %s", data, string(buf[:n]))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
runtime.GC()
|
|
|
|
|
|
|
|
time.Sleep(1 * time.Second)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func TestTLSALPNClient(t *testing.T) {
|
|
|
|
func TestTLSALPNClient(t *testing.T) {
|
|
|
@ -308,6 +314,8 @@ func TestTLSALPNClient(t *testing.T) {
|
|
|
|
if string(buf[:n]) != data {
|
|
|
|
if string(buf[:n]) != data {
|
|
|
|
t.Errorf("need: %s, got: %s", data, string(buf[:n]))
|
|
|
|
t.Errorf("need: %s, got: %s", data, string(buf[:n]))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
runtime.GC()
|
|
|
|
|
|
|
|
time.Sleep(1 * time.Second)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func TestTLSServerSNI(t *testing.T) {
|
|
|
|
func TestTLSServerSNI(t *testing.T) {
|
|
|
@ -378,6 +386,8 @@ func TestTLSServerSNI(t *testing.T) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
conn.Close()
|
|
|
|
conn.Close()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
runtime.GC()
|
|
|
|
|
|
|
|
time.Sleep(1 * time.Second)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func TestTLSGetPeerCert(t *testing.T) {
|
|
|
|
func TestTLSGetPeerCert(t *testing.T) {
|
|
|
@ -405,4 +415,6 @@ func TestTLSGetPeerCert(t *testing.T) {
|
|
|
|
t.Error(err)
|
|
|
|
t.Error(err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
resp.Write(os.Stdout)
|
|
|
|
resp.Write(os.Stdout)
|
|
|
|
|
|
|
|
runtime.GC()
|
|
|
|
|
|
|
|
time.Sleep(1 * time.Second)
|
|
|
|
}
|
|
|
|
}
|
|
|
|