bugfix sni

This commit is contained in:
AJ ONeal 2020-11-16 23:23:07 -07:00
parent a62f46c070
commit 1c43e7a732
1 changed files with 3 additions and 1 deletions

View File

@ -69,7 +69,6 @@ func GetHostname(b []byte) (hostname string, err error) {
current += 2 current += 2
if extensionType == 0 { if extensionType == 0 {
// Skip over number of names as we're assuming there's just one // Skip over number of names as we're assuming there's just one
current += 2 current += 2
@ -81,6 +80,9 @@ func GetHostname(b []byte) (hostname string, err error) {
nameLen := (int(rest[current]) << 8) + int(rest[current+1]) nameLen := (int(rest[current]) << 8) + int(rest[current+1])
current += 2 current += 2
hostname = string(rest[current : current+nameLen]) hostname = string(rest[current : current+nameLen])
if len(hostname) > 0 {
break
}
} }
current += extensionDataLength current += extensionDataLength