// 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.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
0x0039,
0x0038,
0x0037,
0x0036,
0x0088,
0x0087,
0x0086,
0x0085,
0xc00f,
0xc005,
tls.TLS_RSA_WITH_AES_256_CBC_SHA,
0x0084,
tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,
tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,
0x0033,
0x0032,
0x0031,
0x0030,
0xe011,
0xe001,
0x009a,
0x0099,
0x0098,
0x0097,
0x0045,
0x0044,
0x0043,
0x0042,
0xc00e,
0xc004,
tls.TLS_RSA_WITH_AES_128_CBC_SHA,
0x0096,
0x0041,
0x0007,
0xe013,
0xe003,
tls.TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA,
0xc008,
0x0016,
0x0013,
0x0010,
0x000d,
0xc00d,
0xc003,
tls.TLS_RSA_WITH_3DES_EDE_CBC_SHA,
0x00ff,
},
CompressionMethods: []byte{
0x00, // compressionNone
},
Extensions: []tls.TLSExtension{
code generation error: short curves },
}
tlsConn.ApplyPreset(&clientHelloSpec)
n, err = tlsConn.Write([]byte("Hello, World!"))
// or tlsConn.Handshake() for better control