mirror of
https://github.com/bettercap/bettercap
synced 2025-08-13 02:06:57 -07:00
adding vendor folder
This commit is contained in:
parent
49c65021ea
commit
c304ca4696
1145 changed files with 369961 additions and 2 deletions
39
vendor/github.com/inconshreveable/go-vhost/tls_test.go
generated
vendored
Normal file
39
vendor/github.com/inconshreveable/go-vhost/tls_test.go
generated
vendored
Normal file
|
@ -0,0 +1,39 @@
|
|||
package vhost
|
||||
|
||||
import (
|
||||
"crypto/tls"
|
||||
"net"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestSNI(t *testing.T) {
|
||||
var testHostname string = "foo.example.com"
|
||||
|
||||
l, err := net.Listen("tcp", "127.0.0.1:12345")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
defer l.Close()
|
||||
|
||||
go func() {
|
||||
conf := &tls.Config{ServerName: testHostname}
|
||||
conn, err := tls.Dial("tcp", "127.0.0.1:12345", conf)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
conn.Close()
|
||||
}()
|
||||
|
||||
conn, err := l.Accept()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
c, err := TLS(conn)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
if c.Host() != testHostname {
|
||||
t.Errorf("Connection Host() is %s, expected %s", c.Host(), testHostname)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue