// 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.Client(tcpConn, &tlsConfig, utls.HelloCustom)
clientHelloSpec := tls.ClientHelloSpec {
CipherSuites: []uint16{
0xc038,
tls.DISABLED_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,
tls.DISABLED_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,
0x00b3,
0x006b,
0xc09b,
0xc097,
0xc077,
0xc073,
0xc067,
0xc04d,
0xc049,
0xc045,
0x00c4,
0x0088,
0xc037,
tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,
tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,
0x00b2,
0x0067,
0xc09a,
0xc096,
0xc076,
0xc072,
0xc066,
0xc04c,
0xc048,
0xc044,
0x00be,
0xc036,
0xc035,
0xc021,
0xc01e,
tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,
tls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,
0x0091,
0x0090,
0x0045,
0x0039,
0x0033,
0xc079,
0xc078,
0xc075,
0xc074,
0xc04f,
0xc04e,
0xc04b,
0xc04a,
0xc02a,
0xc029,
0xc026,
0xc025,
0xc00f,
0xc00e,
0xc005,
0xc004,
0xc041,
0xc040,
0x00c2,
0x00bc,
0x0086,
0x0069,
0x0043,
0x00ff,
},
CompressionMethods: []byte{
0x00, // compressionNone
0x01
},
Extensions: []tls.TLSExtension{
code generation error: short sig_algs },
}
tlsConn.ApplyPreset(clientHelloSpec)
n, err = tlsConn.Write("Hello, World!")
// or tlsConn.Handshake() for better control