// 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{
tls.DISABLED_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,
tls.DISABLED_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,
0x006b,
0xc077,
0xc073,
0xc04d,
0xc049,
0xc045,
0x00c4,
0x0088,
tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,
tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,
0x0067,
0xc076,
0xc072,
0xc04c,
0xc048,
0xc044,
0x00be,
tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,
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,
0x0045,
0x0039,
0x0033,
0xc079,
0xc078,
0xc075,
0xc074,
0xc04f,
0xc04e,
0xc04b,
0xc04a,
0xc02a,
0xc029,
0xc026,
0xc025,
0xc00f,
0xc00e,
0xc005,
0xc004,
0x003f,
0xc041,
0xc040,
0x00c2,
0x00bc,
0x0086,
0x0069,
0x0043,
0x0037,
0x0031,
tls.DISABLED_TLS_RSA_WITH_AES_256_CBC_SHA256,
tls.TLS_RSA_WITH_AES_128_CBC_SHA256,
0xc03d,
0xc03c,
0x00c0,
0x0084,
0x0041,
tls.TLS_RSA_WITH_AES_256_CBC_SHA,
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