// 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{
0x00b7,
0xc099,
0x00ad,
0xccae,
tls.TLS_RSA_WITH_AES_256_GCM_SHA384,
0xc0a1,
0xc09d,
tls.DISABLED_TLS_RSA_WITH_AES_256_CBC_SHA256,
tls.TLS_RSA_WITH_AES_256_CBC_SHA,
0x00c0,
0x0084,
0x0095,
0xc03d,
0xc051,
0xc069,
0xc06f,
0xc07b,
0xc093,
0xff01,
0x00ac,
0xc0a0,
0xc09c,
tls.TLS_RSA_WITH_AES_128_GCM_SHA256,
tls.TLS_RSA_WITH_AES_128_CBC_SHA256,
tls.TLS_RSA_WITH_AES_128_CBC_SHA,
0x00ba,
0x00b6,
0x0096,
0x0041,
0xc098,
0x0007,
0x0094,
0xc03c,
0xc050,
0xc068,
0xc06e,
0xc07a,
0xc092,
tls.TLS_RSA_WITH_RC4_128_SHA,
0x0004,
0x0092,
tls.TLS_RSA_WITH_3DES_EDE_CBC_SHA,
0x0093,
0xfeff,
0xffe0,
0x0062,
0x0009,
0x0061,
0xfefe,
0xffe1,
0x0064,
0x0060,
0x0008,
0x0006,
0x0003,
0x00b9,
0x00b8,
0x002e,
0x003b,
0x0002,
0x0001,
0xff00,
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