// 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{
0x0043,
0x0037,
0x0031,
0xc099,
0xc098,
0xc095,
0xc094,
0xc069,
0xc068,
0xc065,
0xc064,
0xc03d,
0xc03c,
0x00c0,
0x00b7,
0x00b6,
0x00af,
0x00ae,
0x0095,
0x0094,
0x008d,
0x008c,
0x0041,
tls.TLS_RSA_WITH_AES_128_CBC_SHA,
0xc043,
0xc042,
0xc03f,
0xc03e,
0xc022,
0xc01f,
0x00c3,
0x00c1,
0x00bd,
0x00bb,
0x0087,
0x0085,
0x006a,
0x0068,
0x0044,
0x0042,
0x0038,
0x0036,
0x0032,
0x0030,
0xc020,
0xc01d,
0xc034,
0xc01c,
0xc01b,
0xc01a,
tls.TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA,
0xc00d,
0xc008,
0xc003,
0x0093,
0x008f,
0x008b,
0x0016,
0x0013,
0x0010,
0x000d,
tls.TLS_RSA_WITH_3DES_EDE_CBC_SHA,
0x009a,
0x0099,
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