// 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{
tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,
tls.DISABLED_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,
tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
0xc04c,
0xc060,
0xc04d,
0xc061,
0xc076,
0xc08a,
0xc077,
0xc08b,
tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305,
tls.OLD_TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256,
0xc010,
tls.TLS_ECDHE_RSA_WITH_RC4_128_SHA,
0xc003,
0x004a,
0xc004,
0x004b,
0xc025,
0xc02d,
0xc005,
0x004c,
0xc026,
0xc02e,
0xc04a,
0xc05e,
0xc04b,
0xc05f,
0xc074,
0xc088,
0xc075,
0xc089,
0x0049,
0xc001,
0x0047,
0xc002,
0x0048,
0x004e,
0x004d,
0xc00d,
0xc00e,
0xc029,
0xc031,
0xc00f,
0xc02a,
0xc032,
0xc04e,
0xc062,
0xc04f,
0xc063,
0xc078,
0xc08c,
0xc079,
0xc08d,
0xc00b,
0xc00c,
0x005b,
0x005c,
0x0057,
0xc017,
0x005a,
0xc018,
0xc019,
},
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