// import tls "github.com/refraction-networking/utls"
tcpConn, err := net.Dial("tcp", "tlsfingerprint.io:443")
if err != nil {
fmt.Printf("net.Dial() failed: %+v\n", err)
return
}
config := tls.Config{ServerName: "tlsfingerprint.io"}
// This fingerprint includes feature(s), not fully supported by TLS.
// uTLS client with this fingerprint will only be able to to talk to servers,
// that also do not support those features.
tlsConn := tls.UClient(tcpConn, &tlsConfig, tls.HelloCustom)
clientHelloSpec := tls.ClientHelloSpec {
CipherSuites: []uint16{
0x0066,
0x0004,
0x0015,
0x0012,
0x000f,
0x000c,
0x0009,
0x0065,
0x0064,
0x0063,
0x0062,
0x0061,
0x0060,
0x0014,
0x0011,
0x000e,
0x000b,
0x0008,
0x0006,
0x0003,
0xc047,
0xc019,
0xc018,
0x00c5,
0x00bf,
0x0089,
0x006d,
0x006c,
0x0046,
0x003a,
0x0034,
0xc046,
0xc017,
0x009b,
0x001b,
0xc016,
0x001a,
0x0019,
0x0018,
0x0017,
0xc03b,
0xc03a,
0xc039,
0xc015,
0xc010,
0xc00b,
0xc006,
0xc001,
0x00ba,
0x00b9,
0x00b8,
0x00b5,
0x00b4,
0x00b1,
0x00b0,
0x002e,
0x002d,
0x002c,
0x0002,
0x0001,
0x00e8,
0x00e7,
0x00e6,
0x00e5,
0x00ff,
},
CompressionMethods: []byte{
0x00, // compressionNone
0x01
},
Extensions: []tls.TLSExtension{
code generation error: short sig_algs },
}
tlsConn.ApplyPreset(&clientHelloSpec)
n, err = tlsConn.Write([]byte("Hello, World!"))
// or tlsConn.Handshake() for better control