21 lines
444 B
Go
21 lines
444 B
Go
package faketls
|
|
|
|
import (
|
|
"bytes"
|
|
"encoding/hex"
|
|
"testing"
|
|
)
|
|
|
|
func TestSNIDomain_TelegramD0Prefix(t *testing.T) {
|
|
// Domain tail from ee5ba9cf...dd0632e6170692e73746570612e6f6e65 (0xd0 + "c.api.stepa.one" hex)
|
|
d, err := hex.DecodeString("d0632e6170692e73746570612e6f6e65")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
got := SNIDomain(d)
|
|
want := []byte("c.api.stepa.one")
|
|
if !bytes.Equal(got, want) {
|
|
t.Fatalf("got %q want %q", got, want)
|
|
}
|
|
}
|