// 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{
0x0059,
0xc015,
0xc016,
0x0058,
0x004f,
0x0052,
0x0051,
0x0050,
0x0053,
0x0056,
0x0055,
0x0054,
0x0081,
0x0083,
0x0080,
0x0082,
0xc102,
0xc100,
0xc103,
0xc105,
0xc101,
0xc104,
0xc106,
0x0029,
0x0026,
0x002a,
0x0027,
0x002b,
0x0028,
0x0023,
0x001f,
0x0022,
0x001e,
0x0025,
0x0021,
0x0024,
0x0020,
0x0000,
0xc0aa,
0xc0ab,
0x008b,
0x008c,
0x00ae,
0xc0a4,
0xc0a8,
0x00a8,
0x008d,
0x00af,
0xc0a5,
0xc0a9,
0x00a9,
0xc064,
0xc06a,
0xc065,
0xc06b,
0xc094,
0xc08e,
0xc095,
0xc08f,
0xccab,
0x002c,
0x00b0,
0x00b1,
0x008a,
},
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