// 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{
0xc09f,
0xc0a3,
0x009f,
0xc044,
0xc052,
0xc045,
0xc053,
0x0045,
0x00be,
0xc07c,
0x0088,
0x00c4,
0xc07d,
0xccaa,
0xcc15,
0x0015,
0x009a,
0x000b,
0x000d,
0x0030,
0x003e,
0x00a4,
0x0036,
0x0068,
0x00a5,
0xc03e,
0xc058,
0xc03f,
0xc059,
0x0042,
0x00bb,
0xc082,
0x0085,
0x00c1,
0xc083,
0x000c,
0x0097,
0x000e,
0x0010,
0x0031,
0x003f,
0x00a0,
0x0037,
0x0069,
0x00a1,
0xc040,
0xc054,
0xc041,
0xc055,
0x0043,
0x00bc,
0xc07e,
0x0086,
0x00c2,
0xc07f,
0x000f,
0x0098,
0x0019,
0x0017,
0x001b,
0x0034,
0x006c,
0x00a6,
0x003a,
},
CompressionMethods: []byte{
0x00, // compressionNone
},
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